5
« on: October 20, 2019, 10:06:51 PM »
idk if this is gonna answer your question, but this is how i hande BoS - it's pretty old, but it worked great for me,
;=====================================Bag Of Sending===================================================
set %use_bos #true ;set to #true if you want to use a Bag of Sending
set %refil_bos #true ;set to #true if you want to script to refil your Bag of sending
set %refil_limit 1 ;Amount of charges left before recharging your BoS
;=====================================Skin & Leather===================================================
gosub bagofsending POF_ #findstack ;#findstack can be any variable that reprisents how much of whatever you want to send
;--------------------------------------------------------------
;--------------------------------------------------------------
sub bagofsending
set %sendloot %1
if %1 = pof && %2 < %lim
return
set *charge . %bos *charge . %bos + 1
gosub scan_charges %bos
set %curcharge #result
if #result <= %refil_limit
{
if %refil_bos = #true
gosub refill_bos
else
set %training_mode #true
}
finditem %bos C_ , #backpackid
if #findkind <> -1
{
gosub separate_string %sendloot _
set %loot_loop 1
for %i 1 %t_num
{
set %loot_search %return . %loot_loop
finditem %loot_search C_ , #backpackid
for #findindex 1 #findcnt
{
if #findkind <> -1
{
wait 15
set #lobjectid %bos
event macro 17 0
target 5s
wait 10
set #ltargetid #findid
event macro 22 0
set %try4 %try4 +1
if %try4 > 4
{
set %try4 0
break
}
}
}
set %loot_loop %loot_loop + 1
}
}
else
{
event macro 3 0 Can't Find your BoS. Reverting to Training mode
set %training_mode #true
}
set %chargeused %chargeused + 1
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub set_bos
finditem CKF C_ , #backpackid
if #findkind <> -1
{
for #findindex 1 #findcnt
{
gosub scan_charges #findid
set %curcharge #result
if %curcharge >= 1
{
set %bos #findid
return
}
}
}
else
{
Display You do not have a bag of sending in your pack. Set Use_BoS to False and restart
halt
}
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub scan_charges
finditem %1 C_ , #backpackid
set %tempid #findid
event property #findid
set %string #property
str len %string
set %length #strres
str pos %string s:
set %del #strres + 2
str del %string 1 %del
set %string #strres
str len %string
set %l #strres
set %movestr %strres - 1
str pos %string $
set %del #strres
str del %string %del %l
return #strres
;--------------------------------------------------------------
;--------------------------------------------------------------
sub refill_bos
finditem EUO C_ , #backpackid
if #findkind <> -1
{
set #lobjectid #findid
event macro 17 0
target 5s
wait 10
set #ltargetid %bos
event macro 22 0
wait 10
gosub journal2 saturated
if #result = #true
{
event macro 3 0 Your BoS cannot be charged. Reverting to training mode
set %training_mode #true
return #false
}
}
else
{
event macro 3 0 Can't Find your Powder of Fortification. Reverting to Training mode
set %training_mode #true
return #false
}
return
;-------------------------------------------------------------
;-------------------------------------------------------------
sub separate_string
set %t_num 0
str Count %1 %2
for %i 1 #strres
{
set %var %2
str len %1
set %length #strres
str pos %1 %var
set %del #strres - 1
str left %1 %del %length
set %return . %i #strres
set %del1 %del + 1
str del %1 1 %del1
set %1 #strres
set %t_num %t_num + 1
}
return
;----------------------------------------------------------------------
;----------------------------------------------------------------------
i don't think that snippet would work, but it shows you how to go through the process of using/recharging a BoS and switching to a new one .
I use it mainly in my dex farmer
;==================================
; Script Name: Freddy's Dexxer Farmer
; Author: Freddy
; Version: 1.9.3
; Client Tested with: 7. something
; EUO version tested with: 1.5 (Build 202)
; Shard: OSI
; Revision Date: 5/25/12
; Public Release: 12/31/07
; Subs used:
;==================================
set %use_new_menu #true
set %cast_ev #false
;---------DO NOT EDIT BELOW UNLESS YOU CHOOSE NOT TO USE THE MENU--------------------------------
;=====================================Mob Setup========================================================
set %training_mode #false ;set to #true if you want to kill without looting & recalling
set %dura_warn 15 ; Durability of a piece of armor before warning
set %dura_scan_timeout 15 ;in minutes
set %remove_armor_on_warn #true ;set to @true if you want the script to unequip armor below dura threshold and place it in your pack,
set %monsterkill af_FE_AE_DE_JB_DJ_OE_RE_BJ_yc_of_mg_pd_hd_fd_ne_i_te_oj_ed_qd_ae_fe_de_sg_NG_IG_YG_XG ;the item type of the monsters you want to kill.
set %follow_monster #false ;Set to #true if you want to pathfind to the monster.
set %honor_monster #false ; set to false if you don't want to honor the monster.
set %tile_radius 14 ; The max radius to scan for monsters
;=====================================Looting and Banking==============================================
set %loot jjg_ ;the item(s) you want to loot. Leave blank to not open corpses w/ war cleaver
set %stackables ;ICHB_HVF_UVF_FVF_EVF_OVF_VUF_GVF_RVF_BVF_VVF_NVF_ZVF_
set %stack_limit 300
set %gold_limit 13000 ;limit of which to send gold.
set %loot_gold #true ;Set to #true if you want to loot gold. set to #false and leave %loot blank if you want to use butcher's war cleaver without opening corpses.
set %bankbox OJAXMTD ;The item id of the container in your bank box to drop gold
set %weight_left_before_deposit 50 ;The amount of weight left on char before loot is deposited in bank or via BoS
;=====================================Bag Of Sending===================================================
set %use_bos #true ;set to #true if you want to use a Bag of Sending
set %refil_bos #true ;set to #true if you want to script to refil your Bag of sending
set %refil_limit 1 ;Amount of charges left before recharging your BoS
;=====================================Skin & Leather===================================================
set %skin #true ;set to #false if you don't want to skin. Must be set to #true if you want to use the butcher's war cleaver
set %use_war_cleaver #true ; set to #true if you want to use a war cleaver instead of a kinfe and scissors
set %skin_tool YPCSAUD ;if of your skinning tool.
set %weight_before_split 420 ;the total weight in your pack before script splits leather so you can loot it all
;=====================================Healing and Casting==============================================
set %cast_EoO #false ; set to #false if you don't want to cast enemy of one.
set %cast_DF #false ; set to #false if you don't want to cast divine fury.
set %cast_CW #true ; set to #false if you don't want to cast consecrate weapon
set %cast_Con #true ;set to #true to cast confidence
set %cont_hit_lim 95 ;the amount of hits before confidence is casted
set %mana_limit 50 ;If mana is below this, you wont cast spells.
set %r_method c ;Recall method - c = sacred journey
;=====================================Runebook Setup===================================================
set %bankbook ZCAXMTD ;Item id of your bank runebook.
set %dungeonbook KCAXMTD ;Item id of your dungeon runebook.
set %bank_start 1 ;The number where your bank rune starts in your runebook.
set %bank_max 1 ;The number where your bank rune ends in your runebook.
set %dung_start 7 ;8 ;The number where your dungeon rune starts in your runebook.
set %dung_max 9 ;10 ;The number where your dungeon rune ends in your runebook.
;======================================================================================================
;version 1.9.3 5/25/2012
;Menu should display stats in realtime
;Edited the time to wait for a monster to approach you if you select do not move
;version 1.9.2 11/17/2011
;Fixed a bug with using a bag of sending
;Version 1.9.1 11/15/2011
;- Added the option to remove curse
;- Added a dynamic wait time for consecrate weapon that is loosely based on your
; Karma lvl and chiv skill.
;- Fixed an issue with sending leather to the bank with the new menu update.
;version 1.9 11/14/2011
;- Added a menu to customize variables.
;Version 1.8 10/24/2011
;-Added support for Butcher's War Cleaver.
; Use: Place war cleaver in main pack and script will find it for you.
; If you want to just loot leather and not open corpses, set
; %loot_golddto #false and set %loot to N/A or leave it blank
;-There is now a separate variable for stackable loot. You can set the amount
; of items in the stack before it gets sent to the bank
;Version 1.7 10/21/2011
; Added armor scanning. Will warn if durability of a piece of armor
; is below your set threshold.
;Version 1.6 10/18/2011
; -added a stat tracking menu
;- Adjusted the BoS sub - you can have multiple bags in pack,
; script will now correctly find BoS.
;version 1.5 10/14/2011
;- Fixed the monster scanner - it now correctly attacks the closest target
;-Added Confidence, user can set when it's cast based on minimum hits specified
;-Split leather - Sometimes when your pack is nearly full, leather is too heavy for the script to loot and cut,
; so based on specified hard limit, the script will split the looted leather into smaller chuncks so it can be
; looted and cut correctly.
;-Added a recharge limit so user can specify at what charge to refil their BoS
;-Added a recharge BoS variable. Set to #true if script should recharge it, #false if not.
;-Enemy of One works correctly now
;-Organized the variable setup list so it's easier to set
;-Fixed an error with the sub that sets the itemid of the BoS.
;Version 1.4 10/3/2011
;-Added a variable to allow one to adjust the calculated max weight.
;-Fixed the Recall sub to work with rune 11 and 12 in a runebook.
;Version 1.3 9/15/2011
;-Added a Max Tile radius to scan for monsters
;-Changed script to attack closest monster first
;-Script will pause when character dies. Gargoyles included
;Version 1.2 9/14/2011
;-Added the ability to use bags of sendings.
;Place a BoS and the script will automatically find it. Make sure you have powder of fortification
;If you run out of PoF and charges on your BoS the script will revert to training mode.
;If you decide to use a BoS your character will not recall.
;-Removed old recall subs and replaced them with my own.
;-Removed unnecessary code
;Version 1.1
;-Changed enemy of one and diving fury to cast only when needed.
;-Added honor. If your character is too far away to honor, it will attack it and honor when the mosnter is closer.
;-Fixed the recall issues.
;-Removed a lot of unnecessary code
;Version 1.01
;4/14 Added a Training mode.
;-----------------Don't Edit Below---------------
set %version 1.9.3
if %use_new_menu = #true
gosub first_menu
if %skin = #true
{
if jjg notin %loot
{
if %loot = n/a
set %loot jjg_
else
set %loot %loot , _ , jjg , _ ,
}
}
if %cast_CW = #true
{
gosub set_cw_timer
set %cw_timer #result
}
set #lpc 1000
gosub startup
set #lpc 20
mloop:
if #menubutton = rescan
{
gosub scan_armor
set #menubutton n/a
}
gosub kill %monsterkill %tile_radius
if %killed = #true
set *stt tru
if %training_mode <> #true
{
gosub loot
wait 8
gosub weight_check
}
set %honored #false
gosub update_men
if #scnt >= %dura_timer
{
set %dura_timer %wait_this + #scnt
gosub scan_armor
}
if %cast_rc = #true
gosub cast_rc
goto mloop
;--------------------------------------------------------------
;--------------------------------------------------------------
sub scan_armor
set #lpc 1000
gosub show_men
finditem * C_ , #charid
for #findindex 1 #findcnt
{
gosub scan_dura #findid
if #result = #true && !dura_max <> N/A
{
event property #findid
set %temp_sid #property
str pos %temp_sid $
set %del #strres - 1
if %del > 22
set %del 22
str left %temp_sid %del
set %prop #strres
set %slash /
menu list add durabox %prop , #spc , !dura_cur , %slash , !dura_max
if !dura_cur <= %dura_warn
{
set %problem %problem + 1
event macro 3 0 %prop , #spc , !dura_cur , #spc , Durability , #spc , left! , #spc , Please , #spc , Stop , #spc , Script , #spc , And , #spc , Fix , #spc , It!!!
menu delete durawarn
menu Font Size 8
menu Font Style b
menu Font Color Red
menu Text durawarn 15 10 ( %problem warnings ) %prop is below dura threshold
if %remove_armor_on_warn = #true
{
wait 10
exevent drag #findid #findstack
wait 10
exevent dropc #backpackid
wait 10
}
}
}
}
set #lpc 20
set %problem 0
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub scan_dura
namespace push
namespace local dura_check
set !item %1
set !dura durability
event property !item
if !dura in #property
{
set !temp_string #property
str pos !temp_string durability
set !delete_this #strres + 10
str del !temp_string 1 !delete_this
set !temp_string #strres
str len !temp_string
set !delete_this #strres - 1
str left !temp_string !delete_this
set !temp_string #strres
wait 1
str pos !temp_string /
set !delete_this #strres - 1
str left !temp_string !delete_this
set !dura_cur #strres
wait 1
str pos !temp_string /
set !delete_this #strres - 1
str right !temp_string !delete_this
set !dura_max #strres
namespace push
return #true
}
return #false
;--------------------------------------------------------------
;--------------------------------------------------------------
sub loot
finditem YFM G_2
if #findkind <> -1
{
set %mobs_killed %mobs_killed + 1
set %corpse #findid
if %skin = #true && %training_mode = #false
{
if %use_war_cleaver = #true
set %skin_tool %cleaverid
set #lobjectid %skin_tool
event macro 17 0
target
set #ltargetid %corpse
event macro 22 0
wait 17
}
if %loot_gold = #false && %loot = N/A
{
ignoreitem %corpse
return
}
set #lobjectid %corpse
event macro 17 0
wait 5
gosub wait_gump container_gump 144_212 3
if #result = #false
return
wait 5
set %loot_container #contid
wait 13
ignoreitem %corpse
}
if #findkind = -1
return
gosub grab_items
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub grab_items
if %loot_gold = #true
{
wait 4
finditem POF C_ , %loot_container
if #findkind <> -1
{
exevent drag #findid #findstack
wait 13
exevent dropc #backpackid
wait 13
}
}
finditem * C_ , %loot_container
for %i 1 #findcnt
{
finditem %loot C_ , %loot_container
if #findkind <> -1
{
exevent drag #findid #findstack
wait 13
exevent dropc #backpackid
wait 13
}
finditem %stackables C_ , %loot_container
if #findkind <> -1
{
exevent drag #findid #findstack
wait 13
exevent dropc #backpackid
wait 13
}
}
if %skin = #true && %use_war_cleaver <> #true
{
lloop:
gosub weight_check
wait 2
while #true
{
finditem EEG C_ , %loot_container
if #findkind <> -1
{
set #lid #findcnt
if #weight > %weight_before_split
{
set %damount #findstack / 2
if #findstack <= 15
set %damount #findstack
}
else
set %damount #findstack
exevent drag #findid %damount
wait 14
exevent dropc #backpackid
wait 15
}
if #findkind = -1
break
wait 5
finditem kag C_ , #backpackid
set #lobjectid #findid
event macro 17 0
target 2s
finditem eeg C_ , #backpackid
set #ltargetid #findid
event macro 22 0
wait 5
wait 10
}
}
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub weight_check
finditem POF C_ , #backpackid
for #findindex 1 #findcnt
{
if %gold_limit >= 60000
set %lim 55000
else
set %lim %gold_limit
if #findstack >= %lim
{
set %gold_am %gold_am + #findstack
set *total_gold *total_gold + #findstack
if %use_bos = #false
{
gosub recall_to_bank
wait 1s
gosub deposit_items
wait 1s
gosub recall_to_dungeon
}
else
{
gosub bagofsending POF_ #findstack
}
}
}
set %current_weight #weight
set %weight_left %max_weight - %current_weight
if %weight_left <= %weight_left_before_deposit
{
if %skin = #true
{
finditem JJG C_ , #backpackid
set %leatherct %leatherct + #findstack
set *total_leather *total_leather + #findstack
}
if %use_bos = #false
{
gosub recall_to_bank
wait 1s
gosub deposit_items
wait 1s
gosub recall_to_dungeon
}
else
{
gosub bagofsending %loot
return
}
}
finditem %stackables C_ , #backpackid
for #findindex 1 #findcnt
{
if #findstack >= %stack_limit
{
if %use_bos = #false
{
gosub recall_to_bank
wait 1s
gosub deposit_items
wait 1s
gosub recall_to_dungeon
}
else
gosub bagofsending #findid , _ #findstack
}
}
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub set_cleaver
if %skin = #true && %training_mode = #false
{
set %bstring butcher's , #spc , war , #spc , cleaver
finditem HFR C_ , #backpackid
if #findkind <> -1
{
for #findindex 1 #findcnt
{
event property #findid
if %bstring in #property
{
set %cleaverid #findid
return
}
}
}
else
{
display Can't Find your %bstring
halt
}
}
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub deposit_items
loop:
msg bank$
gosub wait_gump container_gump 180_240 10
if #result = #false
{
set %fail_chance %fail_chance + 1
if %fail_chance >= 3
{
display Can't open bank. Halting
halt
}
goto loop
}
finditem %bankbox *
if #findkind <> -1
{
finditem POF C_ , #backpackid
exevent drag #findid #findstack
wait 12
exevent dropc %bankbox
wait 12
finditem * C_ , #backpackid
for %i 1 #findcnt
{
finditem %loot C_ , #backpackid
if #findkind <> -1
{
exevent drag #findid #findstack
wait 12
exevent dropc %bankbox
wait 12
}
ignoreitem #findid
}
finditem %stackables C_ , #backpackid
{
for #findindex 1 #findcnt
{
if #findkind <> -1
{
exevent drag #findid #findstack
wait 12
exevent dropc %bankbox
wait 12
}
}
}
}
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub recall_to_bank
set %currunebook Bank
set %trip_to_bank %trip_to_bank + 1
set %total_recall %total_recall + 1
gosub update_men
bloop:
gosub recall %bankbook %rune %r_method 3
if #result <> #true
{
if %r_method = c && #result = tithe_fail
{
display You are out of tithe pts.
set %training_mode #true
return
}
wait 20
set %rune %rune + 1
if %rune >= %bank_max
{
set %rune %bank_start
}
goto bloop
}
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub recall_to_dungeon
set %rune1 %rune1 + 1
set %total_recall %total_recall + 1
set %currunebook Dungeon
dloop:
if %rune1 >= %dung_max
{
set %rune1 %dung_start
}
gosub recall %dungeonbook %rune1 %r_method 3
if #result <> #true
{
wait 20
set %rune1 %rune1 + 1
if %rune1 >= %dung_max
{
set %rune1 %dung_start
}
goto dloop
}
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub kill
set %killed #false
set #lpc 1000
set %monster %1
set %distance %2
set %m_dist 1
while #true
{
if #hits = 0
{
event macro 3 0 You Are Dead!
pause
}
for %m_dist 0 %distance
{
finditem %monster G_ , %m_dist
if #findkind <> -1
{
set %close_mon #findid
set %start_dist %m_dist
set %m_dist 0
set %montimer #scnt + 20
break
}
}
finditem %close_mon *
if #findkind <> -1
{
set *statcheck #true
set #lobjectid #findid
set #ltargetid #findid
repeat
gosub journal2
if #result = #true
{
ignoreitem #findid
return
}
if %honored = #false && %honor_monster = #true
{
sloop:
event macro 49 1
target 5s
wait 5
event macro 22 0
wait 5
gosub journal2 _too_far_
if #result = #true
{
event macro 27 0
goto sloop
}
set %honored #true
}
if #scnt > %montimer
{
finditem %close_mon *
if #finddist > 5 || #finddist = %start_dist
{
ignoreitem %close_mon
break
}
}
event macro 27 0
if %cast_ev = #true
gosub cast_ev
if %cast_EoO = #true
gosub cast_eo1 #findrep
if %cast_con = #true
gosub cast_con
if #stamina < %max_stam
gosub cast_divine
if %cast_CW = #true
gosub check_cast
if %cast_rc = #true
gosub cast_rc
gosub check_a #findid
until #result = #false
set %killed #true
break
}
if #findkind = -1
break
}
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub cast_ev
if %cast_ev = #true && a notin #charstatus
{
if #mana > %mana_limit && %evtimer <= #scnt
{
set %mana #mana
event macro 15 147
set %evtimer #scnt + 20
set %cwtimer %cwtimer + 5
}
}
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub cast_rc
if %cast_rc = #true && a notin #charstatus
{
if #maxhits < %start_hit || #maxmana < %start_mana || #maxstam < %start_stam
{
set %mana #mana
event macro 15 209
target
event macro 23 0
}
}
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub cast_con
if %cast_con = #true && a notin #charstatus
{
if #hits <= %cont_hit_lim && #mana > %mana_limit
{
if %contimer <= #scnt
{
set %mana #mana
event macro 15 146
set %contimer #scnt + 20
wait 10
}
}
}
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub cast_eo1
if %cast_EoO = #true && a notin #charstatus
{
if #findrep <> 5
{
if #mana > %mana_limit && %eo1timer <= #scnt && #findrep <> 5
{
event macro 15 206
set %eo1timer #scnt + 5
wait 17
}
}
}
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub cast_divine
if %cast_df = #true && a notin #charstatus
{
if #mana > %mana_limit
{
event macro 15 205
wait 10
}
}
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub check_cast
if %cast_CW = #true
{
if #mana > %mana_limit
{
if %cwtimer1 <= #scnt
{
set %mana #mana
event macro 15 203
set %cwtimer1 #scnt + %cw_timer
}
}
}
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub check_a
set %follow %1
finditem %follow *
if #findkind <> -1
{
if %follow_monster = #true
{
if #finddist > 2
event pathfind #findx #findy #findz
}
return #true
}
else
return #false
return #false
;--------------------------------------------------------------
;--------------------------------------------------------------
sub fix_maxweight
if #maxweight > 550
return 550
else
return #maxweight
return #maxweight
;--------------------------------------------------------------
;--------------------------------------------------------------
sub fcrmenu
set %prop1 Faster , #spc , Cast , #spc , Recovery
gosub GetProp %prop1
set %FCR #result
set %prop2 Lower , #spc , Mana , #spc , Cost
gosub GetProp %prop2
set %Lmc #result
set %fcr %fcr * 5
set %wait %fcr
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub findwait
set %wait1 %scriptwait * 50
set %fcr1 %fcr * 10
set %wait2 %wait1 / %fcr1
set %determinedwait %wait2 + 10
if %fcr = 0
set %determinedwait %scriptwait
wait 2
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub bagofsending
set %sendloot %1
if %1 = pof && %2 < %lim
return
set *charge . %bos *charge . %bos + 1
gosub scan_charges %bos
set %curcharge #result
if #result <= %refil_limit
{
if %refil_bos = #true
gosub refill_bos
else
set %training_mode #true
}
finditem %bos C_ , #backpackid
if #findkind <> -1
{
gosub separate_string %sendloot _
set %loot_loop 1
for %i 1 %t_num
{
set %loot_search %return . %loot_loop
finditem %loot_search C_ , #backpackid
for #findindex 1 #findcnt
{
if #findkind <> -1
{
wait 15
set #lobjectid %bos
event macro 17 0
target 5s
wait 10
set #ltargetid #findid
event macro 22 0
set %try4 %try4 +1
if %try4 > 4
{
set %try4 0
break
}
}
}
set %loot_loop %loot_loop + 1
}
}
else
{
event macro 3 0 Can't Find your BoS. Reverting to Training mode
set %training_mode #true
}
set %chargeused %chargeused + 1
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub set_bos
finditem CKF C_ , #backpackid
if #findkind <> -1
{
for #findindex 1 #findcnt
{
gosub scan_charges #findid
set %curcharge #result
if %curcharge >= 1
{
set %bos #findid
return
}
}
}
else
{
Display You do not have a bag of sending in your pack. Set Use_BoS to False and restart
halt
}
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub scan_charges
finditem %1 C_ , #backpackid
set %tempid #findid
event property #findid
set %string #property
str len %string
set %length #strres
str pos %string s:
set %del #strres + 2
str del %string 1 %del
set %string #strres
str len %string
set %l #strres
set %movestr %strres - 1
str pos %string $
set %del #strres
str del %string %del %l
return #strres
;--------------------------------------------------------------
;--------------------------------------------------------------
sub refill_bos
finditem EUO C_ , #backpackid
if #findkind <> -1
{
set #lobjectid #findid
event macro 17 0
target 5s
wait 10
set #ltargetid %bos
event macro 22 0
wait 10
gosub journal2 saturated
if #result = #true
{
event macro 3 0 Your BoS cannot be charged. Reverting to training mode
set %training_mode #true
return #false
}
}
else
{
event macro 3 0 Can't Find your Powder of Fortification. Reverting to Training mode
set %training_mode #true
return #false
}
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub startup
set %wait_this ( %dura_scan_timeout * 60 )
set %dura_timer %wait_this + #scnt
set %message4 Can't_get_there
set %max_stam #maxstam - 50
set %cwtimer1 #scnt
set %contimer #scnt
set %eo1Timer #scnt
set %evtimer #scnt
set %rune %bank_start
set %honored #false
set %rune1 %dung_start
set %beginning #systime
set %gold_am 0
set %leatherct 0
set %mobs_killed 0
set %curcharge 0
set %weightleft 0
set %pot_am 0
set %chargeused 0
set %trip_to_bank 0
set %total_recall 0
set %currunebook 0
set #menubutton n/a
if %use_war_cleaver = #true && %training_mode = #false
gosub set_cleaver
if %use_bos = #true && %training_mode = #false
gosub set_bos
gosub fcrmenu
gosub fix_maxweight
set %max_weight #result
gosub weight_check
finditem yfm G_21
for %i 1 #findcnt
{
finditem yfm G_21
ignoreitem #findid
}
gosub show_men
gosub update_men
gosub scan_armor
if %cast_rc = #true
{
set %start_mana #maxmana
set %start_hit #maxhits
set %start_stam #maxstam
}
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub recall
namespace push
namespace local recall
set !runebook %1
set !position %2
set !method %3
set !tries %4
set !c_tries 1
if !method = c
{
if #tp < 15
return tithe_fail
}
if #weight >= #maxweight
return weight_fail
try_again:
finditem !runebook C_ , #backpackid
if #findkind <> -1
{
set #lobjectid #findid
event macro 17 0
gosub wait_gump generic_gump 452_236 3
gosub find_page !position
gosub click_button %coord
set !cur_cpos #charposx , _ , #charposy , _ , #charposz
set !r_side !position % 2
if !r_side <> 0 || !position = 1
set !side L
else
set !side R
if !method = R
{
if !side = L
set !c_loc 140_145
else
set !c_loc 300_145
}
if !method = C
{
if !side = L
set !c_loc 140_180
else
set !c_loc 300_180
}
gosub click_button !c_loc
set %timer1 #scnt + 5
while #true
{
for %u 1 20
{
set !n_cur_pos #charposx , _ , #charposy , _ , #charposz
if !n_cur_pos <> !cur_cpos
return #true
gosub journal2 reagent
if #result = #true
return reg_fail
wait 2
}
gosub journal2 Something_is_blocking
if #result = #true && !c_tries <= !tries
{
set !c_tries !c_tries + 1
wait 2s
goto try_again
}
if #result = #true && !c_tries > !tries
return #false
if !c_tries >= !tries
return #false
if #scnt > %timer1 && !n_cur_pos = !cur_cpos
{
set !c_tries !c_tries + 1
wait 2s
goto try_again
}
}
return #false
}
else
{
return #false
}
;-------------------------------------------------------------
;-------------------------------------------------------------
sub separate_string
set %t_num 0
str Count %1 %2
for %i 1 #strres
{
set %var %2
str len %1
set %length #strres
str pos %1 %var
set %del #strres - 1
str left %1 %del %length
set %return . %i #strres
set %del1 %del + 1
str del %1 1 %del1
set %1 #strres
set %t_num %t_num + 1
}
return
;----------------------------------------------------------------------
;----------------------------------------------------------------------
sub click_button
set !parsestring %1 , _
gosub separate_string !parsestring _
set !clickx #contposx + %return1
set !clicky #contposy + %return2
click !clickx !clicky
return
;-------------------------------------------------------------
;-------------------------------------------------------------
sub find_page
if %1 <= 2
{
set %page 1
set %coord 140_195
}
if %1 <= 4 && %1 > 2
{
set %page 2
set %coord 175_195
}
if %1 <= 6 && %1 > 4
{
set %page 3
set %coord 210_195
}
if %1 <= 8 && %1 > 6
{
set %page 4
set %coord 245_195
}
if %1 <= 10 && %1 > 8
{
set %page 5
set %coord 310_195
}
if %1 <= 12 && %1 > 10
{
set %page 6
set %coord 345_195
}
if %1 <= 14 && %1 > 12
{
set %page 7
set %coord 380_195
}
if %1 <= 16 && %1 > 14
{
set %page 8
set %coord 415_195
}
return %page
;-------------------------------------------------------------
;-------------------------------------------------------------
sub wait_gump
set %timer #scnt + %3
repeat
if #contsize = %2 && #contname = %1
return #true
until #scnt >= %timer
return #false
;--------------------------------------------------------------
;--------------------------------------------------------------
sub journal2
set %timer #scnt
While #true
{
set %_jindex #jindex
if #jindex >= %_jindex
{
scanjournal %_jindex
if %1 in #journal
return #true
return #false
}
}
return ;should never get this far
;--------------------------------------------------------------
;--------------------------------------------------------------
sub show_men
menu clear
menu Window Title Freddy's Farmer
menu Window Color White
menu Window Size 392 230
menu Font Transparent #true
menu Font Align Right
menu Shape EUOShape1 0 0 421 257 3 7 1 Black 1 Maroon
menu Shape EUOShape2 8 8 377 33 3 7 1 Black 7 White
menu Font Name Segoe UI
menu Font Size 12
menu Font Style
menu Font Color Green
menu Font Align Left
menu Font BGColor White
menu Text EUOLabel1 12 16 Freddy's Farmer
menu Shape EUOShape3 8 40 377 185 3 7 1 Black 7 Green
menu Shape EUOShape4 16 44 361 173 3 7 1 Black 7 White
menu Font Name MS Sans Serif
menu Font Size 8
menu Text EUOLabel4 324 24 Version %version
menu Font Size 12
menu Font Color WindowText
menu Text EUOLabel2 20 52 Gold:
menu Text EUOLabel3 20 72 Leather:
menu Text EUOLabel5 20 92 Mobs Killed:
menu Text EUOLabel8 20 192 Total Time:
menu Text EUOLabel9 20 172 Weight Left:
if %use_bos = #True
{
menu Text EUOLabel6 20 112 Charges left:
menu Text EUOLabel7 20 152 PoT Left:
menu Text EUOLabel10 20 132 Charges Used:
menu Font Style b
menu Font Color Green
menu Text chargeused 131 132 %chargeused
menu Text potamt 88 152 %pot_am
menu Text curcharge 120 112 %CURCHARGE
}
else
{
menu Text EUOLabel6 20 112 Trips to Bank:
menu Text EUOLabel7 20 152 Runebook:
menu Text EUOLabel10 20 132 Total Recalls:
menu Font Style b
menu Font Color Green
menu Text curcharge 120 112 %trip_to_bank
menu Text chargeused 120 132 %total_recall
menu Text potamt 96 152 %currunebook
}
menu Font Style b
menu Font Color Green
menu Text goldamount 60 52 %GOLD_AM
menu Text leathercount 84 72 %leatherct
menu Text mobs_kill 108 92 %MOBS_KILLED
menu Text weightleft 108 172 %weight_left
menu Text outtime 100 192 %outtime
menu Font Size 8
menu Font Style
menu Font Color WindowText
menu Font BGColor Window
menu List Create DuraBox 180 52 189 137
menu Font Size 8
menu Font Style
menu Font Color WindowText
menu Font BGColor BtnFace
menu Button rescan 196 192 125 21 Rescan
menu Show
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub update_men
set #lpc 1000
gosub time
menu Font Size 12
menu Font Style b
menu Font Color Green
menu delete outtime
menu Text outtime 100 192 %outtime
menu delete goldamount
set %c_gold_am %GOLD_AM + #gold
menu Text goldamount 60 52 %c_gold_am
menu delete leathercount
if %skin = #false
set %leatherct not , #spc , selected
finditem JJG C_ , #backpackid
set %nc #findstack + %leatherct
menu Text leathercount 84 72 %nc
menu delete mobs_kill
menu Text mobs_kill 108 92 %MOBS_KILLED
menu delete weightleft
menu Text weightleft 108 172 %weight_left
if %use_bos = #True
{
gosub scan_charges %bos
set %curcharge #result
menu delete curcharge
menu Text curcharge 120 112 %CURCHARGE
finditem EUO C_ , #backpackid
if #findkind <> -1
set %pot_am #findstack
else
set %pot_am 0
menu delete potamt
menu Text potamt 88 152 %pot_am
set #lpc 20
menu delete chargeused
menu Text chargeused 131 132 %chargeused
menu delete chargetotal
menu Text chargetotal 131 152 t: *charge . %bos
}
else
{
menu delete curcharge
menu Text curcharge 120 112 %trip_to_bank
menu delete chargeused
menu Text chargeused 120 132 %total_recall
menu delete potamt
menu Text potamt 100 152 %currunebook
}
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub time
set %time #systime - %beginning
gosub timeformat
return
;--------------------------------------------------------------
;--------------------------------------------------------------
;==================================
; Script Name: Lion's Timer Formatting Subs
; Author: Lion
; Version: 1.1
; Client Tested with: 4.0.0p/q
; EUO version tested with: 1.41 build 0075
; Shard OSI / FS: Any
; Revision Date: 5th March 2004
; Public Release: 4th March 2003
; Purpose: Time in ms to standard MM:DD:HH:MM:SS
;==================================
;==================================
;Simple (hours:mins:secs)
;==================================
sub timeformat
str len %time
set %timelenght #strres - 3
str left %time %timelenght
set %t1 #strres / 3600
set %t2 #strres % 3600 / 60
set %t3 #strres % 3600 % 60
set %outtime %t1
for %i 2 3
{
str len %t . %i
if #strres = 1
{
set %outtime %outtime , : , 0 , %t . %i
set *time %outtime , : , %t . %i
}
if #strres <> 1
{
set *time %outtime , : , %t . %i
set %outtime %outtime , : , %t . %i
}
}
return
;--------------------------------------------------------------
;--------------------------------------------------------------
sub first_menu
mloop:
set #lpc 1000
menu Clear
menu Window Title Freddy's Farmer
menu Window Color White
menu Window Size 574 539
menu Font Transparent #true
menu Font Align Right
menu Shape EUOShape1 0 0 573 617 3 7 1 Black 1 Maroon
menu Shape EUOShape2 8 8 557 33 3 7 1 Black 7 White
menu Font Name Segoe UI
menu Font Size 12
menu Font Style
menu Font Color Green
menu Font Align Left
menu Font BGColor White
menu Text EUOLabel1 12 16 Freddy's Farmer
menu Shape EUOShape3 8 40 557 491 3 7 1 Black 7 Green
menu Shape EUOShape4 16 48 538 474 3 7 1 Black 7 White
menu Font Name MS Sans Serif
menu Font Size 8
menu Text EUOLabel4 492 24 Version %version
menu Shape EUOShape5 24 72 341 109 3 7 1 Black 7 White
menu Font Size 10
menu Font Style b
menu Font Color WindowText
menu Font Transparent #false
menu Text EUOLabel2 24 52 Monster Setup
menu Font Style
menu Text EUOLabel3 28 76 Kill List:
menu Font Size 8
menu Text EUOLabel5 192 104 Tile Radius
menu Font Size 10
menu Font Style b
menu Text EUOLabel6 24 188 Armor Setup
menu Shape EUOShape6 24 208 165 97 3 7 1 Black 7 White
menu Shape EUOShape7 200 208 165 97 3 7 1 Black 7 White
menu Text EUOLabel7 200 188 Bag of Sending
menu Font Size 8
menu Font Style
menu Text EUOLabel8 28 216 Low Durability warning:
menu Text EUOLabel9 28 240 Durability Scan timeout:
menu Text EUOLabel10 208 264 Charge to refill
menu Font Size 10
menu Font Style b
menu Text EUOLabel11 24 312 Loot Setup
menu Shape EUOShape8 24 332 341 181 3 7 1 Black 7 White
menu Font Size 8
menu Font Style
menu Text EUOLabel12 32 340 Loot List
menu Text EUOLabel13 32 364 Stack List
menu Text EUOLabel14 32 388 Stack Limit:
menu Text EUOLabel15 168 408 Gold Limit:
menu Text EUOLabel16 32 460 Skin Tool (if War cleaver not selected)
menu Text EUOLabel17 32 484 Bank Container ID (if BoS not chosen)
menu Shape EUOShape9 376 72 169 157 3 7 1 Black 7 White
menu Font Size 10
menu Font Style b
menu Text EUOLabel18 376 52 Casting Setup:
menu Font Size 8
menu Font Style
menu Text EUOLabel20 380 200 Conf HP:
menu Font Size 10
menu Font Style b
menu Text EUOLabel21 376 240 Runebook Setup:
menu Shape EUOShape10 376 256 169 161 3 7 1 Black 7 White
menu Font Size 8
menu Font Style
menu Text EUOLabel22 380 260 Bankbook:
menu Text EUOLabel23 384 304 Start:
menu Text EUOLabel24 464 304 End:
menu Text EUOLabel25 384 328 Dungeon Book:
menu Text EUOLabel26 384 368 Start:
menu Text EUOLabel27 468 368 End:
menu Text EUOLabel28 384 392 Method:
menu Font BGColor Window
menu Edit killbox 76 76 233 *fred_kill_list
menu Font BGColor White
if *follow_tick = #true
menu Check follow_monster 28 100 113 25 #true Follow Monster
else
menu Check follow_monster 28 100 113 25 #false Follow Monster
if *training_tick = #true
menu Check training_mode 28 152 169 25 #true Training Mode (Does not loot)
else
menu Check training_mode 28 152 169 25 #false Training Mode (Does not loot)
menu Font BGColor Window
menu Combo Create radiusbox 252 100 105
for %i 1 16
menu combo add radiusbox %i
menu combo select radiusbox *radius_tick
menu Font BGColor White
if *honor_tick = #true
menu Check honor_monster 28 124 105 25 #true Honor Monster
else
menu Check honor_monster 28 124 105 25 #false Honor Monster
menu Font Color White
menu Font BGColor Green
menu Button killbutton 312 76 49 21 Target
menu Font Color WindowText
menu Font BGColor Window
menu Edit durabox 144 212 41 *fred_low_dura
menu Edit dura_timeout 144 236 41 *fred_dura_timeout
menu Font BGColor White
if *removedura_tick = #true
menu Check remove_armor 28 260 141 41 #true Remove armor on low durability warning
else
menu Check remove_armor 28 260 141 41 #false Remove armor on low durability warning
if *usebos_tick = #true
menu Check use_bos 204 216 125 21 #true Use Bag of Sending
else
menu Check use_bos 204 216 125 21 #false Use Bag of Sending
if *refilbos_tick = #true