ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: razeial on July 18, 2012, 04:31:36 PM
-
Ok guys, I'm using Guadah's Multiskill trainer to train up Bushido. What I also want is a script to scan my journal for a weapon break, and then rearm the last type of weapon so will this script do that while guadah's script runs?
set %weapontype YSF
scanjournal 1
if weapon_has_been_destroyed in #journal
{
gosub RearmWep
}
goto Mainloop
Sub RearmWep
SET #lobjecttype %weapontype
FINDITEM %weapontype C_ , %backpackid
IF #FINDKIND = -1
{
HALT
}
SET #RHANDID #findid
WAIT %ShortDelay
event macro 24 2
WAIT 1s
return
-
Oh my.... perhaps this could help you out. Of course you'll have to make a couple changes for ID's and which hand the item is in....
set %throwing FID_THY_YND_NND_ ; id types of the weapon
repeat
finditem %throwing C_ , #charID
if #findCnt < 1
gosub equip
wait 1
until #false
sub equip
finditem %throwing C_ , #backpackID
{
if #findCnt < 1 ; oops, none in the backpack
halt
}
set #rhandid #findid
event macro 24 2
wait 10
return
You could use a finditem and a specific ID then have hotkeys to set the specific weapon/spellbook you want armed. Easy to fast switch it this way.
To make it a sub routine just change this part:
sub CervsWeaponSwapORama
finditem %throwing C_ , #charID
if #findCnt < 1
gosub equip
wait 1
return
And of course put this somewhere in your mainloop:
gosub CervsWeaponSwapORama
-
So........something like this??!?!?
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
; MAIN LOOP
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
set %weapon YSF_ ; id types of the weapon
Gosub CervsWeaponSwapORama
scanjournal 1
if is_destroyed_by_the_attack in #journal
{
gosub equip
}
repeat
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; SUBS
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
sub CervsWeaponSwapORama
finditem %weapon C_ , #charID
if #findCnt < 1
gosub cervequip
wait 1
until #false
if #false
{
display You are out of Weapons!
halt
}
sub equip
finditem %throwing C_ , #backpackID
{
if #findCnt < 1 ; oops, none in the backpack
halt
}
set #rhandid #findid
event macro 24 2
wait 10
return
-
I think you misunderstood Cerv...
In his method, you're scanning your paperdoll to look for whatever weapon type. If it doesn't find it on the paperdoll (meaning it broke) it goes into the subroutine to equip a new one. No need to scan the journal at all (which is good, because journal scanning can be QUITE messy and not reliable)
The only edit you'll need to make to Cerv's script is to change the first line to whatever weapon types you need:
set %throwing FID_THY_YND_NND_ ; id types of the weapon
Change to:
set %throwing YSF_ ; id types of the weapon
(Disregard the fact that his variable is called "%throwing", you could simply change all occurrences of that variable in the script to "%weapontypes")
As he said, you may also need to change which hand is being equipped ("event macro 24 2" versus "event macro 24 1") and use #lhandid instead of #rhandid, but that's dependent on which hand the weapon is getting equipped into.
So your final script might look like:
set %weapontypes YSF_ ; id types of the weapon
repeat
finditem %weapontypes C_ , #charID
if #findCnt < 1
gosub equip
wait 1
until #false
sub equip
finditem %weapontypes C_ , #backpackID
{
if #findCnt < 1 ; oops, none in the backpack
halt
}
set #rhandid #findid
event macro 24 2
wait 10
return