Author Topic: Looking for help  (Read 3848 times)

0 Members and 1 Guest are viewing this topic.

Offline M4yH3mTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Activity:
    0%
  • Reputation Power: 1
  • M4yH3m has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Looking for help
« on: January 05, 2020, 07:51:08 AM »
0
Hey everyone!! I’m trying to write a script, but I need some guidance. I’ve read the tutorials on here, and they helped somewhat. But what I have in mind, is a little different. I don’t want to put specifics on here, but would love it if an experienced coder could pm me, and maybe we can work together to create the script.

Offline Crisis

  • Global Moderator
  • *
  • *
  • Posts: 2998
  • Activity:
    3.4%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +205
  • Referrals: 2
    • View Profile
Re: Looking for help
« Reply #1 on: January 05, 2020, 09:23:29 AM »
0
TBH, the best way to get help is to post what you have an let others look at it and help with fixes or suggestions.

Offline M4yH3mTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Activity:
    0%
  • Reputation Power: 1
  • M4yH3m has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Looking for help
« Reply #2 on: January 05, 2020, 09:32:57 AM »
0
TBH, the best way to get help is to post what you have an let others look at it and help with fixes or suggestions.

Well, I don’t have anything written just yet, but I will give it a go, and post what I write.

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Looking for help
« Reply #3 on: January 07, 2020, 07:04:27 AM »
0
Hey everyone!! I’m trying to write a script, but I need some guidance. I’ve read the tutorials on here, and they helped somewhat. But what I have in mind, is a little different. I don’t want to put specifics on here, but would love it if an experienced coder could pm me, and maybe we can work together to create the script.

Post what you want to do, its possible it already exists and you just don't know,  or sections of code that you could use already exist.
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline M4yH3mTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Activity:
    0%
  • Reputation Power: 1
  • M4yH3m has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Looking for help
« Reply #4 on: January 07, 2020, 04:33:19 PM »
0
So I want a script for my archer to auto attack a monster that I set up Via a target curser in the beginning of the script.

This is what I have so far. I know its probably not even close to being correct, But I am trying lol.
I'd like to be able to set this so it will attack within 10 tiles of the enemy, but I don't know how to do that yet either.
Any help is very much welcomed.


Code: easyuo
  1. ;==================================
  2. ; Script Name: Mayhem's Auto Attack
  3. ; Author: Mayhem
  4. ; Version: 1.00
  5. ; EUO version tested with: 1.6.0.334
  6. ; Shard OSI
  7. ; Revision Date:
  8. ; Public Release:
  9. ; Global Variables Used: N/A
  10. ; Purpose: Automatically Attacks Selected Target
  11. ;===================================
  12.  
  13. set %hotkey DELETE  ; Pauses Script
  14. set %paused #false
  15. set %Enemy N/A
  16.  
  17. goto Setup
  18.  
  19. Setup:
  20. {
  21.      set #targcurs 0
  22.      set #targcurs 1
  23.  
  24.      event SysMessage Target The Enemy You Wish To Attack
  25.  
  26.      while #targcurs = 1
  27.      {
  28.           wait 1
  29.      }
  30.  
  31.      set %Enemy #ltargetid
  32.      
  33.      event SysMessage Enemy set.
  34.      
  35.      goto Loop
  36. }
  37.  
  38. Loop:
  39. {
  40.      onhotkey %hotkey
  41.      {
  42.          event sysmessage Paused.
  43.          wait 10
  44.          goto Pause
  45.      }
  46.      
  47.      Pause:
  48. {
  49.      set %paused #true
  50.  
  51.      while %paused = #true
  52.      {
  53.         onhotkey %hotkey
  54.         {
  55.             event sysmessage Resumed.
  56.             set %paused #false
  57.             wait 20
  58.             goto Loop
  59.         }
  60.      }
  61. }
  62. Return
  63.  
« Last Edit: January 07, 2020, 04:47:42 PM by TrailMyx »

Offline Gaderian

  • Elite
  • *
  • *
  • Posts: 486
  • Activity:
    0%
  • Reputation Power: 10
  • Gaderian barely matters.Gaderian barely matters.
  • Respect: +50
  • Referrals: 3
    • View Profile
Re: Looking for help
« Reply #5 on: January 08, 2020, 07:56:20 AM »
0
"Go ahead ask me: 'Should I use hard waits or timers?'"
You say:"Should I"
Gaderian:"Timers!"
You Say:"use hard waits or timers?"

The serious side of timer use is illustrated here: http://www.scriptuo.com/index.php?topic=12094.msg101926#msg101926

However, every time I go back and look at this [AutoLooter] script, I realize I had wrote it in my zen state of EUO scripting - so it makes my brain hurt.

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Looking for help
« Reply #6 on: January 09, 2020, 07:33:15 AM »
0
I hate gotos and repeated code so i rewrote your script with no gotos.   And added in an attack function...     This is just an example for you to expand your knowledge with...


Code: [Select]
set %hotkey DELETE  ; Pauses Script
set %paused #false
set %Enemy N/A
 
; Setup:
set #targcurs 0
set #targcurs 1
event SysMessage Target The Enemy You Wish To Attack
while #targcurs = 1
         {
          wait 1
         }
set %Enemy #ltargetid
set %enemykind #ltargetkind
event SysMessage Enemy set.

; main Loop:
repeat
  onhotkey %hotkey
    {
       if %Paused
           {
            event sysmessage Resumed.
            set %paused #false
            wait 20
            }
       else
            {
            event sysmessage Paused.
            wait 10
            set %paused #true
            }
       }
   if ! %Paused
        gosub AttackEnemy
  wait 1
until #charghost = #true    ; repeat until dead.
halt  ; end the script

sub AttackEnemy
   finditem %enemyid G_10   ; find enemy within a radius of 10 from me.
   If #findcnt > 0
     {   ; if found attack it.
     set #ltargetID %enemyid
     set #ltargetkind  %enemykind   
    event maco  ....      ; attackdont rember the event macro numbers.
     }
return
« Last Edit: January 09, 2020, 07:37:19 AM by Endless Night »
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Looking for help
« Reply #7 on: January 09, 2020, 07:21:54 PM »
0
I hate gotos and repeated code so i rewrote your script with no gotos.   And added in an attack function...     This is just an example for you to expand your knowledge with...

I miss how GOTOs would make Cerveza's veins in his head nearly burst. lol
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline M4yH3mTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Activity:
    0%
  • Reputation Power: 1
  • M4yH3m has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Looking for help
« Reply #8 on: January 09, 2020, 07:22:55 PM »
0
I hate gotos and repeated code so i rewrote your script with no gotos.   And added in an attack function...     This is just an example for you to expand your knowledge with...

I miss how GOTOs would make Cerveza's veins in his head nearly burst. lol

So I was kind of on the right track?

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Looking for help
« Reply #9 on: January 10, 2020, 09:36:41 AM »
0
I hate gotos and repeated code so i rewrote your script with no gotos.   And added in an attack function...     This is just an example for you to expand your knowledge with...

I miss how GOTOs would make Cerveza's veins in his head nearly burst. lol

So I was kind of on the right track?

It looked like your code would work yes.  You just needed to add attack function.    Finditem offers an easy way to see if something is in a 10 tile radius    G_10  see code in above post
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Looking for help
« Reply #10 on: January 10, 2020, 09:37:30 AM »
0
I hate gotos and repeated code so i rewrote your script with no gotos.   And added in an attack function...     This is just an example for you to expand your knowledge with...

I miss how GOTOs would make Cerveza's veins in his head nearly burst. lol

Gotos make me go bat *bleep* crazy lol  ...  :o
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Tags: