Is this dificult ?

Ask for help

Moderators: Murderator+, Murderator

Post Reply
Knight1106
Posts: 64
Joined: 2005-09-08 18:38:12

Is this dificult ?

Post by Knight1106 »

Well, i was try to do a script that when i press its hotkey its starts to heal and stop only when i press the hotkey again, but with this script below the functions aren't terminate, the script stops to heal but the funstion T still running, Why ?

Anyone knows how to do what i want ?
plz tell me

thanks

Code: Select all

sub T() #Heal
 var m=uo.mana
 if uo.getglobal('Healing')=='On' then
 uo.setglobal('Healing','Off')
 else
 uo.setglobal('Healling','On')
 end if
 repeat
 m=uo.mana
 uo.cast('Heal','self')
 uo.deletejournal()
 while uo.mana>=m || uo.injournal('fizzles')
 wait(1)
 wend
 until uo.getglobal('Healing')=='Off'
end sub
Raisefamous
Posts: 40
Joined: 2006-07-06 08:30:59

Post by Raisefamous »

Here you go

Code: Select all

sub he() 
if uo.life < uo.str then
uo.bandageself()
wait(300)
uo.usetype('0x1B76')
wait(300)
uo.msg('.drink_heal_great')
wait(300)
uo.usetype('0x0E2A')
uo.cast('Greater Heal','self')
end if
end sub


Something like your scpt but a bit better,I think
Nmy
Expert!
Posts: 2152
Joined: 2005-09-14 15:31:58
Location: Latvia

Post by Nmy »

Code: Select all

##########################################
Sub test()
##########################################
   If uo.getglobal('test')=='11' then
   uo.setglobal('test',00)
   uo.print(' !!! -= Test: off =- !!! ')
   uo.exec('terminate test')
   else
   uo.setglobal('test',11)
   uo.print(' !!! -= Test: on =- !!! ')
   end if
#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#

;script
;script
;script

#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#
                                       
   uo.setglobal('test',00)
   uo.print(' !!! -= Test: off =- !!! ')
##########################################
end sub
##########################################
Knight1106
Posts: 64
Joined: 2005-09-08 18:38:12

Post by Knight1106 »

NMY wrote:

Code: Select all

##########################################
Sub test()
##########################################
   If uo.getglobal('test')=='11' then
   uo.setglobal('test',00)
   uo.print(' !!! -= Test: off =- !!! ')
   uo.exec('terminate test')
   else
   uo.setglobal('test',11)
   uo.print(' !!! -= Test: on =- !!! ')
   end if
#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#

;script
;script
;script

#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#
                                       
   uo.setglobal('test',00)
   uo.print(' !!! -= Test: off =- !!! ')
##########################################
end sub
##########################################


Thank you, now it is working... But, can you explain me what is wrong in my Script ? They appears to be the same o.O

thanks
Nmy
Expert!
Posts: 2152
Joined: 2005-09-14 15:31:58
Location: Latvia

Post by Nmy »

Code: Select all

uo.exec('terminate test')

if you set global OFF it doesnt means that the script must stop his actions, so you must kill it :twisted: :lol:

or:

Code: Select all

sub T() #Heal
 var m=uo.mana
 if uo.getglobal('Healing')=='On' then
 uo.setglobal('Healing','Off')
 return
 else
 uo.setglobal('Healling','On')
 end if
 while uo.getglobal('Healing')<>'Off'
 m=uo.mana
 uo.cast('Heal','self')
 uo.deletejournal()
 while uo.mana>=m || uo.injournal('fizzles')
 wait(1)
 wend
 wend
end sub
Knight1106
Posts: 64
Joined: 2005-09-08 18:38:12

Post by Knight1106 »

NMY wrote:

Code: Select all

uo.exec('terminate test')

if you set global OFF it doesnt means that the script must stop his actions, so you must kill it :twisted: :lol:

or:

Code: Select all

sub T() #Heal
 var m=uo.mana
 if uo.getglobal('Healing')=='On' then
 uo.setglobal('Healing','Off')
 return
 else
 uo.setglobal('Healling','On')
 end if
 while uo.getglobal('Healing')<>'Off'
 m=uo.mana
 uo.cast('Heal','self')
 uo.deletejournal()
 while uo.mana>=m || uo.injournal('fizzles')
 wait(1)
 wend
 wend
end sub


This new way you post does not works o.O
Nmy
Expert!
Posts: 2152
Joined: 2005-09-14 15:31:58
Location: Latvia

Post by Nmy »

i know... just use the terminate... gl :wink:
Post Reply