Yoko
http://forum.yoko.com.ua/

Antibleed script
http://forum.yoko.com.ua/viewtopic.php?f=20&t=298
Page 1 of 1

Author:  clagio [ 2004-05-09 19:59:27 ]
Post subject:  Antibleed script

I'm trying an anti bleed script, but i have an error, someone cn help me?
Thanks

This is my script:

sub Antibleed()
repeat
wait(100)
until UO.InJournal("bleeding")
UO.DeleteJournal()
Healtime = (5+(0.5*((120-UO.Stamina)/10)))
If Heal > 10 THEN
UO.Say(",exec bandages")
Else
finaltime=(10 - Healtime)
wait(finaltime)
UO.Say(",exec bandages")
Endif
end sub

It wait the word "bleeding" in journal, and then it check stamina, to calculate the time of healing. If the time of healing is > 10 (bleed delay), start to bandage, else wait some seconds (finaltime) and then start to bandage..
i'have an error "Variable Undefined - Healtime", but i can't understand why.. :P

thank you

Author:  totus [ 2004-05-09 20:12:44 ]
Post subject:  maybe this could help

maybe this could help
Code:
sub AntiBleed()
      var LastBangaged = 0
      var CurrentBandage = 0
      repeat
               if UO.InJournal('bleeding') then
                  UO.DeleteJournal()
                  CurrentBandage = UO.Timer()
                  If (CurrentBandage - LastBandaged) >= 100) then
                     LastBandage = CurrentBandage
                     UO.BandageSelf()
                  else
                       Wait((CurrentBandage-LastBandaged)*100)
                       LastBandage = CurrentBandage
                       UO.BandageSelf()
                  endif
               endif
               Wait(100)
      until false
end sub

Author:  Yoko [ 2004-05-09 23:41:53 ]
Post subject:  Re: Antibleed script

clagio wrote:
sub Antibleed()
...
Healtime = (5+(0.5*((120-UO.Stamina)/10)))
end sub

i'have an error "Variable Undefined - Healtime", but i can't understand why.. :P

this is not an EXACT basic where you have no need to define variables.
in injection scripts you must declare them by VAR word. See scripting.txt for more details.

in your case after SUB you must add line
VAR Healtime=0
or something similar

Author:  clagio [ 2004-05-10 17:32:12 ]
Post subject: 

true!!
thank you all :P

another little question.. how can associate the code in cliloc.enu (in this format -> 1060160) to the code the injection give me (in this format 0x05bd) ?

:)

Page 1 of 1 All times are UTC+02:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/