Yoko

All sides of Injection
It is currently 2025-12-24 07:21:17

All times are UTC+02:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Antibleed script
PostPosted: 2004-05-09 19:59:27 
Offline

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


Top
   
 Post subject: maybe this could help
PostPosted: 2004-05-09 20:12:44 
Offline
User avatar

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

_________________
...thinking - 37% complete...


Top
   
 Post subject: Re: Antibleed script
PostPosted: 2004-05-09 23:41:53 
Offline
Site Admin
User avatar

Joined: 2004-04-03 16:49:38
Posts: 1964
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


Top
   
 Post subject:
PostPosted: 2004-05-10 17:32:12 
Offline

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

:)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited