Author Topic: Wither sub  (Read 3442 times)

0 Members and 1 Guest are viewing this topic.

Offline bluepitsTopic starter

  • Jr. Member
  • **
  • Posts: 30
  • Activity:
    0%
  • Reputation Power: 0
  • bluepits has no influence.
  • Gender: Male
  • Respect: +5
  • Referrals: 0
    • View Profile
Wither sub
« on: December 26, 2011, 04:08:32 AM »
0
Hello everone  ive been having a bit of trouble  to get the wither to work in the script. It will wither once on first spot then not wither at all. just moves to spot to spot  Here is part of it maby someone can spot what i am doing wrong and help me fix this plz?


event Pathfind %spot1x %spot1y
wait 5s
if #charposx = %spot1x && #charposy = %spot1y
   goto main
else
   {
   display Can not find starting point. Please go to Beach area and press play.
   pause
   goto firstspot
   }
set %wither #TRUE
}
 
repeat
   gosub NextSpot
   return
   }
gosub wither
  }
  wait 4s
return
 
sub wither
  event macro 15 115 ; wither
return
sub NextSpot
if %spot = 1
   {
   move %spot2x %spot2y 3 10s
   set %spot 2
   return
   }
if %spot = 2
   {
   move %spot3x %spot3y 3 10s
   set %spot 3
   return
   }
if %spot = 3
   {
   move %spot4x %spot4y 3 10s
   set %spot 4
   return
   }
if %spot = 4
   {
   move %spot5x %spot5y 3 10s
   set %spot 5
   return
   }
 if %spot = 5
   {
   move %spot6x %spot6y 3 10s
   set %spot 6
   return
   }
 if %spot = 6
   {
   move %spot7x %spot7y 3 10s
   set %spot 7
   return
   }
   if %spot = 7
   {
   move %spot8x %spot8y 3 10s
   set %spot 8
   return
   }
   if %spot = 8
   {
   move %spot9x %spot9y 3 10s
   set %spot 9
   return
   }
   if %spot = 9
   {
   move %spot10x %spot10y 3 10s
   set %spot 10
   return
   }
   if %spot = 10
   {
   move %spot11x %spot11y 3 10s
   set %spot 11
   return
   }
   if %spot = 11
   {
   move %spot1x %spot1y 3 10s
   set %spot 1
   return
   }

Offline UoLugnutz

  • Full Member
  • ***
  • Posts: 123
  • Activity:
    0%
  • Reputation Power: 2
  • UoLugnutz has no influence.
  • Respect: +25
  • Referrals: 0
    • View Profile
Re: Wither sub
« Reply #1 on: December 26, 2011, 05:32:37 AM »
0
When placing code please use the insert code option. Just makes it a little easier to read. From a quick glance, and not seeing the rest of the code, a few things stick out. First I see a Repeat but no Until. Also I see three right hand brackets but no left brackets to match.

Code: [Select]
set %wither #TRUE
}
 
repeat
   gosub NextSpot
   return
   }
gosub wither
  }
  wait 4s
return


Offline seeriusly

  • Full Member
  • ***
  • Posts: 219
  • Activity:
    0%
  • Reputation Power: 6
  • seeriusly has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 0
    • View Profile
Re: Wither sub
« Reply #2 on: December 26, 2011, 07:01:55 AM »
0
Here is a generic way of doing what you wanted.  It will run to each spot, wither, then run to next spot, wither, nextspot etc etc etc...  You need to plug in your x and y coords to x1 / y1 (spot1x / spot1y) , x2 y2, etc.

Code: [Select]
repeat
gosub pathfind_to_point x1 y1  ; where x1 is your #charposx destination 1, and y1 is #charposy destination 1
gosub wither

gosub pathfind_to_point x2 y2  ; where x2 is your #charposx destination 2, and y2 is #charposy destination 2
gosub wither

gosub pathfind_to_point x3 y3
gosub wither

gosub pathfind_to_point x4 y4
gosub wither

gosub pathfind_to_point x5 y5
gosub wither

gosub pathfind_to_point x6 y6
gosub wither

gosub pathfind_to_point x7 y7
gosub wither

gosub pathfind_to_point x8 y8
gosub wither

gosub pathfind_to_point x9 y9
gosub wither

gosub pathfind_to_point x10 y10
gosub wither

gosub pathfind_to_point x11 y11
gosub wither
until #charghost = yes

;--------------------
sub pathfind_to_point
;%1 #charposx
;%2 #charposy

repeat
set %safety_timer ( #scnt + 20 )
  event pathfind %1 %2
  wait 5
until ( #charposx = %1 && #charposy = %2 ) || ( #scnt >= %safety_timer )
 if #charposx <> %1 && #charposy <> %2
 {
 display ok Can not find starting point. Please go to Beach area and restart script.
 halt
 }
return

;---------------------
sub wither

  event macro 15 115 ; wither
  wait 10

return

Offline bluepitsTopic starter

  • Jr. Member
  • **
  • Posts: 30
  • Activity:
    0%
  • Reputation Power: 0
  • bluepits has no influence.
  • Gender: Male
  • Respect: +5
  • Referrals: 0
    • View Profile
Re: Wither sub
« Reply #3 on: December 26, 2011, 12:29:17 PM »
0
Thank you  that help alot  it work great with the rest. was kinda try to stay away from path finding but i think it helped plant a seed in my mind thx again

Offline camotbik

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Re: Wither sub
« Reply #4 on: January 07, 2012, 09:03:16 AM »
0
I would do something like this.
Code: [Select]
set %monsters AAA_BBB_CCCC
set %spot1x 1111
set %spot1y 2222
set %spot2x 1112
set %spot3y 2223
; ..............

repeat
  repeat
     for %i 1 11
      {
            gosub move %spot . %i . x %spot . %i . y 10
            gosub wither
      }
  until #charghost = yes
until #charghost = yes
stop

Sub Move
   if #charposx <> %1 && #charposy <> %2
   {
       set %_pathfind_fail #false
       set %_jindex #jindex
       set %timer_move ( #sCnt + %3 )
       event pathfind %1 %2
       repeat
           {
               if #jindex >= %_jindex
               {
                   scanjournal %_jindex
                   if can't_get_there in #journal
                       set %_pathfind_fail #true
                   set %_jindex %_jindex + 1
               }
           }
       until #charposx = %1 && #charposy = %2 || #scnt > %timer_move || %_pathfind_fail = #true
       if #charposx <> %1 && #charposy <> %2
           move %1 %2 a %10 , s
   }
return

Sub wither
   finditem %monsters G_4 ; whatever the radius is
   while #findcnt > 0 && #mana > 20 ; just a guess
   {
       event macro 33 ; just a guess, i'm to lazy to look at the manual
       wait 20        ; random wait
       finditem %monsters G_4 ; whatever the radius is
   }
return

the code is untested, just a thought..
« Last Edit: January 07, 2012, 11:04:07 AM by camotbik »
What you witness -- is whatver..
uogamers hybrid.

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: Wither sub
« Reply #5 on: January 17, 2012, 07:25:07 PM »
0
Here is a generic way of doing what you wanted.  It will run to each spot, wither, then run to next spot,

How about even more generic

Code: [Select]
set %monsters AAA_BBB_CCCC
set %spotx1 1111
set %spoty1 2222
set %spotx2 1112
set %spoty2 1112
set %spoty3 2223
set %spoty3 1112

repeat
   for %C 1 3
     {
     gosub pathfind_to_point  %Spotx . %c %Spoty . %c
     gosub wither
     }
until #charghost = yes

;--------------------
sub pathfind_to_point
;%1 #charposx
;%2 #charposy

repeat
set %safety_timer ( #scnt + 20 )
  event pathfind %1 %2
  wait 5
until ( #charposx = %1 && #charposy = %2 ) || ( #scnt >= %safety_timer )
 if #charposx <> %1 && #charposy <> %2
 {
 display ok Can not find starting point. Please go to Beach area and restart script.
 halt
 }
return

;---------------------
sub wither
  event macro 15 115 ; wither
  wait 10
return

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: wither