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

how to using text or values from journal in my script...
http://forum.yoko.com.ua/viewtopic.php?f=20&t=2352
Page 1 of 1

Author:  god [ 2004-12-24 18:38:10 ]
Post subject:  how to using text or values from journal in my script...

First of all I want to say what I want to reach...

I've made script which use heavy crossbow, load time depends on DEX (in journal information is line:

weapon load time: 8943ms

So, I'm looking for this line, get it and use time in ms for wait before next action I do... My problem is that when i'm using this scripot from hide I've never success ... Output is similar but in journal added one line:


weapon load time: 8943ms
Only daggers cab be used...

So look at my script and try point me...

Code:
sub hxb()
;define variables weaponms and pause are reset later in script
 var steps = 10
 var weaponms = 8000
 var pause = 0
 var text = ""
 var hodnota = 0

;---do not edit bellow---
uo.deletejournal()
uo.exec('terminate stealth')
;this  action with heavy crossbow in hand produce line:
;weapon load time: xxxxms
;in hide mode produces 2 lines and in this mode doesn't work
;weapon load time: xxxxms
;Only daggers can be used....
uo.attack("lastattack")   

while NOT UO.InJournal("weapon load time")
   wait(50)
wend
if UO.InJournal("weapon load time") then
;get value of loading weapon
   weaponms = val( mid( uo.journal ( uo.InJournal(0)) ,18,4 ))
;I want shoot from hide mode so minus 250ms is needed for unhide for ex. say shooting ....
 weaponms = weaponms - 250
 pause = weaponms/steps
; uo.print(STR(weaponms))
; uo.print(val(weaponms))
endif

;arm heavy crossbow and finally attack last, now we know weapon load time
 uo.arm("3")
 uo.attack("lastattack")   
;to xx steps before shoot - good for showing how much time i have before  shooting
   for var i=1 to steps
    wait(pause)   
    weaponms=weaponms-pause
      uo.print("------------------" +STR(weaponms)+ "###" +STR(steps-i) )
   next
;needed for unhide and shoot
 uo.serverprint("BOOM")
 uo.serverprint(".warmode off")
end sub

Author:  god [ 2004-12-30 23:19:06 ]
Post subject:  Re: how to using text or values from journal in my script...

god wrote:
First of all I want to say what I want to reach...

I've made script which use heavy crossbow, load time depends on DEX (in journal information is line:

weapon load time: 8943ms

So, I'm looking for this line, get it and use time in ms for wait before next action I do... My problem is that when i'm using this scripot from hide I've never success ... Output is similar but in journal added one line:

[/code]


Thanks for help mates!

Incredible that nobody answered me :)

I've found out how to do it.. So I used this:
Code:
uo.exec("filterspeech on")
uo.exec("filterspeech add 'Only daggers can be used for backstabing.'")


to suppress an output in journal and it is enough.. Might can be usefull for you...

bye bye

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