Antibleed script

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
clagio
Posts: 58
Joined: 2004-05-09 19:53:49

Antibleed script

Post by clagio »

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
totus
Posts: 48
Joined: 2004-04-17 23:02:41
Location: Odessa, Ukraine
Contact:

maybe this could help

Post by totus »

maybe this could help

Code: Select all

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
...thinking - 37% complete...
Yoko
Site Admin
Posts: 1964
Joined: 2004-04-03 16:49:38
Contact:

Re: Antibleed script

Post by Yoko »

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
clagio
Posts: 58
Joined: 2004-05-09 19:53:49

Post by clagio »

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) ?

:)
Post Reply