EASY UO - ARCHERY ================= ;RoadkillsBladeSpiritArcher.txt ; Version 1.0 17 Apr 03 ; 1.1 23 Apr 03 Fixed bugs on testing ; 1.2 23 Apr 03 added xbows and bolts ; 1.3 27 Apr 03 added repeating xbow, 3 sec arm time ; 1.4 13 May 03 fixed bogus "no ammo" problem ; To run this script, load some bows (or xbows) up in your mainpack with plenty ; of arrows or bolts, and BladeSpirit regs, or scrolls in mainpack if using them. ; Find a safe spot to stand and cast BladeSpirits nearby. Script will keep you armed ; and cast BS when needed, and keep attacking BS until out of arrows, and recast BS. ; You can easily cast BladeSpirits (BS) with 31 magery with scrolls. ;=== CONFIGURATION section============== SET %delay 10 ; increase if script too quick for your connect when casting ;===================================== ;=Main Program, don't edit below here ;===================================== INITEVENTS GOSUB Setup GOSUB GetBSCastSpot BS: GOSUB BladeSpirit GOSUB WeaponReplacer %weaponid %weapontype IF G NOTIN #CHARSTATUS event macro 6 SET #LTARGETID %victim EVENT MACRO 27 SET %noAmmoCnt 0 RKBSALoop: FINDITEM %victim IF #FINDKIND = -1 GOTO BS FINDITEM RWF_LNK C IF #FINDKIND = 0 SET %noAmmoCnt 0 IF #FINDKIND = -1 { SET %noAmmoCnt %noAmmoCnt + 1 IF %noAmmoCnt >= 3 2 DISPLAY OK Cant find arrows and bolts in an open pack! HALT } GOTO RKBSALoop HALT ;======================== ; SUBROUTINES============ ;======================== SUB Setup ;purpose: get the type for your weapons and your mainpack ID, ; get and give spell casting info, and check skill lock event macro 8 7 WAIT 20 SET %mainpack #CONTID display ok WELCOME to Roadkill's BladeSpirit Archer! 0-120 Archery$ + I will auto get all your config info, because "Roadkill Rox!"$ + Your backpack ID is %mainpack ,And you may now re-open any packs you want$ display yesno Do you want to use scrolls to cast your BS?$ SET %useScrollsForBS #FALSE IF #DISPRES = yes SET %useScrollsForBS #TRUE IF ! %useScrollsForBS { chooseskill mage IF #SKILL < 400 { DISPLAY OK You don't have the required magery skill (~40)$ + You can buy 23 magery skill from any mage$ + and use scrolls for 33% success (14 INT required).$ HALT } DISPLAY OK Here is your chance to cast BladeSpirits$ + 40 magery = 5%$ + 50 magery = 30%$ + 60 magery = 55%$ + 70 magery = 80%$ + >= 78 magery = 100%$ } chooseskill arch IF #SKILLLOCK <> UP { DISPLAY OK It looks like your archery skill is NOT set to raise$ + Please change it to UP then hit play PAUSE } _dragbow: display ok Drag one of the weapons now and put it in your hand$ + Even if it is already there, drag it OFF then back into hand,$ + you have 5 seconds$ WAIT 5s SET %weaponid #LLIFTEDID FINDITEM %weaponid SET %weapontype #FINDTYPE IF %weapontype NOTIN WOH_JSF_LMH_PPO 2 DISPLAY OK I didn't see a bow or Xbow, lets try again$ GOTO _dragbow RETURN ;======================= SUB GetBSCastSpot ;purpose: get the screen coords for the spot to cast BS DISPLAY OK Please stand where you want to be to run script, $ + then cast Blade Spirits where you want them.$ + You must be within archery distance but safe.$ + When you succeed, press ENTER$ CastSpotLoop: ONHOTKEY ENTER GOTO GetSpot GOTO CastSpotLoop GetSpot: SET %CastSpotx #LTARGETX SET %CastSpoty #LTARGETY SET %CastSpotz #LTARGETZ SET %Ltargetk #LTARGETKIND SET %StandSpotx #CHARPOSX SET %StandSpoty #CHARPOSY RETURN ;====================== SUB BladeSpirit ;ver 1.1 21May03 by Roadkill ;purpose: check for a bladespirit within 20 tiles, cast one if none there ; using magery or scrolls as specified in config section. CheckForBS: FINDITEM SY G_20 IF #FINDKIND = -1 { MOVE %StandSpotx %StandSpoty a IF %useScrollsForBS { FINDITEM VTL C IF #FINDKIND = -1 { DISPLAY OK Can't find any Blade Spirit scrolls$ + in your open packs, go get some. Halting.$ HALT } SET #LOBJECTID #FINDID event macro 17 } IF ! %useScrollsForBS event macro 15 32 SET #LTARGETX %CastSpotx SET #LTARGETY %CastSpoty SET #LTARGETZ %CastSpotz SET #LTARGETKIND %Ltargetk target 8s event macro 22 WAIT 30 GOTO CheckForBS } SET %victim #FINDID RETURN ;======================== SUB WeaponReplacer ; ver 1.0 13 May 03 by Roadkill ;purpose: keep a weapon in your hand, replace it if it breaks ; %1 = %weaponid %2 = %weapontype FINDITEM %weaponid IF #FINDKIND = 0 { event macro 15 0 target key esc WAIT 5 GOTO _rearm } ; find a new weapon of %weapontype in %mainpack and put ; it in your hand FINDITEM %weapontype C_ , %mainpack IF #FINDKIND = -1 { display OK cant find any of your weapons, halting$ HALT } SET %weaponid #FINDID _rearm: SET #LHANDID %weaponid SET #RHANDID %weaponid WAIT 5 event macro 24 2 WAIT 3s event macro 24 1 WAIT 3s RETURN ;=====================================