Bandage script fails

Ask for help

Moderators: Murderator+, Murderator

Post Reply
JaYz
Posts: 6
Joined: 2006-02-18 10:51:15

Bandage script fails

Post by JaYz »

Hello, Anyone know why i doesnt print in the screen when i fail healing with a bandage?

Always prints succeeded, looks like it isnt loading from the journal.

Thanks.

Code: Select all

sub bandage()
uo.deletejournal ()
uo.exec("bandageself")
if UO.InJournal("failed to heal") then
UO.print ("You failed")
uo.exec("bandageself")
else
UO.print ("succeeded")
endif
repeat
until false
end sub
Scripts Writer
Posts: 2259
Joined: 2005-04-19 18:00:29
Location: Московская область
Contact:

Post by Scripts Writer »

Code: Select all

sub bandage() 
uo.deletejournal ()
uo.exec("bandageself")
if UO.InJournal("failed to heal") then
UO.print ("You failed")
uo.exec("bandageself")
else
UO.print ("succeeded")
endif
repeat
until false
end sub


there are no pause before healing and printing. Maybe

Code: Select all

sub bandage() 
  uo.deletejournal()
  uo.exec("bandageself")
  wait(3000)
  if uo.InJournal('You put') then
    uo.Print('Succesful')
    wait(100)
  end if
  if uo.InJournal('You fail')
     uo.Print(' You fail ')
     uo.exec("bandageself")
     wait(3000)
  end if
end sub
JaYz
Posts: 6
Joined: 2006-02-18 10:51:15

Post by JaYz »

Error in line 9.
dmitrykit
Posts: 247
Joined: 2005-06-12 22:12:15

Post by dmitrykit »

JaYz wrote:Error in line 9.

i che s togo? tebe che, dolzhny vydavat' to 4to srazu zoloto domoj nosit' budet? pravj sam, kak tbe nado, i 4tob rabotalo kak ty hocehsh
JaYz
Posts: 6
Joined: 2006-02-18 10:51:15

Post by JaYz »

dmitrykit wrote:
JaYz wrote:Error in line 9.

i che s togo? tebe che, dolzhny vydavat' to 4to srazu zoloto domoj nosit' budet? pravj sam, kak tbe nado, i 4tob rabotalo kak ty hocehsh


???
flake
Expert!
Posts: 746
Joined: 2004-08-11 23:56:17
Location: The Citadel
Contact:

Post by flake »

Code: Select all

sub bandage() 
  uo.deletejournal()
  uo.exec("bandageself")
  wait(3000)
  if uo.InJournal('You put') then
    uo.Print('Succesful')
    wait(100)
  end if
  if uo.InJournal('You fail') Then
     uo.Print(' You fail ')
     uo.exec("bandageself")       
  end if
end sub


P.S.
dmitrykit, он русского не понимает.
JaYz
Posts: 6
Joined: 2006-02-18 10:51:15

Post by JaYz »

flake wrote:

Code: Select all

sub bandage() 
  uo.deletejournal()
  uo.exec("bandageself")
  wait(3000)
  if uo.InJournal('You put') then
    uo.Print('Succesful')
    wait(100)
  end if
  if uo.InJournal('You fail') Then
     uo.Print(' You fail ')
     uo.exec("bandageself")       
  end if
end sub


P.S.
dmitrykit, он русского не понимает.



Thanks but i need a loop because it must repeat everytime.
flake
Expert!
Posts: 746
Joined: 2004-08-11 23:56:17
Location: The Citadel
Contact:

Post by flake »

Code: Select all

sub bandage() 
  repeat
    uo.deletejournal()
    uo.exec("bandageself")
      repeat
        wait(50)
      until uo.InJournal('You put') OR uo.InJournal('You fail')
  until uo.dead()
endsub
JaYz
Posts: 6
Joined: 2006-02-18 10:51:15

Post by JaYz »

flake wrote:

Code: Select all

sub bandage() 
  repeat
    uo.deletejournal()
    uo.exec("bandageself")
      repeat
        wait(50)
      until uo.InJournal('You put') OR uo.InJournal('You fail')
  until uo.dead()
endsub


That isnt what i want. I play in a shard with bandage. When i use bandages on my own char i need 15 seconds to end healing process and when i use them on another char 6 seconds. But when i fail healing myself i dont want wait 15 seconds again i want macro try again.
flake
Expert!
Posts: 746
Joined: 2004-08-11 23:56:17
Location: The Citadel
Contact:

Post by flake »

That's what the macro will do. Once you finish healing or fail, it starts healing again.
JaYz
Posts: 6
Joined: 2006-02-18 10:51:15

Post by JaYz »

flake wrote:That's what the macro will do. Once you finish healing or fail, it starts healing again.


Yeah but where i made the time control?
flake
Expert!
Posts: 746
Joined: 2004-08-11 23:56:17
Location: The Citadel
Contact:

Post by flake »

Have you tried this macro? Try it, and you will see that it is what you wrote you need.
Post Reply