Professional Documents
Culture Documents
C2's Donate-O-Matic 1.4b
C2's Donate-O-Matic 1.4b
;Version: 1.3d
;Shard: OSI
;Purpose: Donate wood and ingots to Collections
;Credits: TM Recall Subs, Ultima for vesper rail
;Revisions:
;11/9 added raw fish steaks, dragon scales, fixed bank issue, id on fish updated
;6/23 added rails and leather to system and fixed display container to display
correct item
;6/25 added rail to vesper donated by Ultima!!!
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;You Set;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
set %travel RE ; RE for recall SJ for sacred
set %bank #false
set %home #true
set %drag_wood_amount 400 ; this is set for leather too!
set %drag_ingot_amount 3000 ; this is fish and scales too!
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gosub SetLocations
Main:
repeat
gosub FindandDonate
gosub Restock
until #charghost = yes
halt
sub FindandDonate
gosub openup
repeat
if %DonateIngots = #true
{
finditem %wood c_ , #backpackid
if #FINDKIND = -1
{
gosub GetMore
if #result = 0 || #result = false
return
}
set %stack #findstack
if #findcol = 2219
gosub click %genx %valy %cont 3 3
if #findcol = 2207
gosub click %genx %very %cont 2 3
if #findcol = 2425
gosub click %genx %agay %cont 2 3
if #findcol = 2213
gosub click %genx %goldy %cont 2 3
if #findcol = 2418
gosub click %genx %brzy %cont 2 3
if #findcol = 2413
gosub click %genx %copy %cont 2 3
if #findcol = 2406
gosub click %genx %shady %cont 1 3
if #findcol = 2419
gosub click %genx %dcy %cont 1 3
if #findcol = 0
gosub click %genx %irony %cont 1 3
}
if %DonateWood = #true
{
finditem TLK c_ , #backpackid
if #FINDKIND = -1
{
gosub GetMore
if #result = #false || #result = 0
return
}
set %stack #findstack
if #findcol = 1151 && %brit = #true
gosub click %genx %bfy %cont 3 3
if #findcol = 1151 && %vesp = #true
gosub click %genx %vfy %cont 2 3
if #findcol = 1194 && %brit = #true
gosub click %genx %bby %cont 3 3
if #findcol = 1194 && %vesp = #true
gosub click %genx %vby %cont 2 3
if #findcol = 1193 && %brit = #true
gosub click %genx %bhy %cont 2 3
if #findcol = 1193 && %vesp = #true
gosub click %genx %vhy %cont 2 3
if #findcol = 1192 && %brit = #true
gosub click %genx %byy %cont 2 3
if #findcol = 1192 && %vesp = #true
gosub click %genx %vyy %cont 2 3
if #findcol = 1191 && %brit = #true
gosub click %genx %bay %cont 2 3
if #findcol = 1191 && %vesp = #true
gosub click %genx %vay %cont 1 3
if #findcol = 2010 && %brit = #true
gosub click %genx %boy %cont 2 3
if #findcol = 2010 && %vesp = #true
gosub click %genx %voy %cont 1 3
if #findcol = 0 && %brit = #true
gosub click %genx %bwy %cont 2 3
if #findcol = 0 && %vesp = #true
gosub click %genx %vwy %cont 1 3
}
if %donatefish = #true
{
finditem HND c_ , #backpackid
if #FINDKIND = -1
{
gosub GetMore
if #result = #false || #result = 0
return
}
set %stack #findstack
gosub click %genx %fishy %cont 2 3
}
if %donatescales = #true
{
finditem STO c_ , #backpackid
if #FINDKIND = -1
{
gosub GetMore
if #result = #false || #result = 0
return
}
set %stack #findstack
gosub click %genx %scalesy %cont 2 3
}
if %donateleather = #true
{
finditem %leather c_ , #backpackid
if #FINDKIND = -1
{
gosub GetMore
if #result = 0 || #result = false
return
}
set %stack #findstack
if #findcol = %scolor
gosub click %genx %spinedy %cont 4 3
if #findcol = %hcolor
gosub click %genx %hornedy %cont 5 3
if #findcol = %bcolor
gosub click %genx %barbedy %cont 5 3
if #findcol = 0
gosub click %genx %regulary %cont 4 3
}
wait 10
until #charghost = yes
halt
return
sub click ;%1 xpos (%genx), %2=ypos, %3= contsize, %4= page, %5=timer
repeat
finditem %containerid g_2
event property #findid
if %containerprop notin #property
ignoreitem #findid
until %containerprop in #property
set %donation #findid
set #lobjectid %donation
event macro 17
wait 20
set %safetytimer #scnt + %5
repeat
until #contsize = %3 || #scnt > %safetytimer
if %4 = 5
{
set %clickx %nx + #contposx
set %clicky %ny + #contposy
click %clickx %clicky
repeat
until #contsize = %3 || #scnt > %safetytimer
wait 10
}
if %4 = 4 || %4 = 5
{
set %clickx %nx + #contposx
set %clicky %ny + #contposy
click %clickx %clicky
repeat
until #contsize = %3 || #scnt > %safetytimer
wait 10
}
if %4 = 3 || %4 = 4 || %4 = 5
set %clickx %nx + #contposx
set %clicky %ny + #contposy
click %clickx %clicky
repeat
until #contsize = %3 || #scnt > %safetytimer
wait 10
}
if %4 = 2 || %4 = 3 || %4 = 4 || %4 = 5
{
set %clickx %nx + #contposx
set %clicky %ny + #contposy
click %clickx %clicky
repeat
until #contsize = %3 || #scnt > %safetytimer
}
wait 10
set %clickx %1 + #contposx
set %clicky %2 + #contposy
click %clickx %clicky
finditem %itemtodonate c_ , #backpackid
wait 20
if #findstack <> 0
msg #findstack $
return
sub GetMore
finditem %itemtodonate c_
if #findkind = -1
return #false
exevent drag #findid %dragamountself
wait 10
exevent dropc #backpackid
wait 20
return #true
sub restock
set %clickx %nx + #contposx
set %clicky %ny + #contposy
click %clickx %clicky r
gosub TM_TravelFromNamedRunebook %travel %secure1 %secure2 %bookname
wait 20
gosub openup
if %home = #true
{
finditem %secure
set #lobjectid #findid
event macro 17
}
if %bank = #true
{
event macro 3 0 bank
set %safetytimer #scnt + 8
repeat
until #contid = %bankbox || #scnt > %safetytimer
set #lobjectid %secure
event macro 17
}
wait 30
finditem %itemtodonate c_ , %secure
if #findkind = -1
{
Display All Done Halting!
halt
}
exevent drag #findid %dragamountself
wait 10
exevent dropc #backpackid
wait 20
finditem %itemtodonate c_ , %secure
exevent drag #findid %dragamountpet
wait 10
exevent dropc %packie
wait 20
gosub TM_TravelFromNamedRunebook %travel %donation1 %donation2 %bookname
if %userail = #true
gosub rail
return
sub SetLocations
;;;;;;;;;;;;;;;;;Brit locations for wood and pages;;;;;;;;;;;;;;;;;;;;;
set %bwy 165 ; 2nd page
set %boy 200 ; 2nd page
set %bay 234 ; 2nd page
set %byy 270 ; 2nd page
set %bhy 301 ; 2nd page
set %bby 165 ; 3rd page
set %bfy 200 ; 3rd page
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;Brit locations for ingots and pages;;;;;;;;;;;;;;;;;;;;;
set %irony 238 ;page one
set %dcy 273 ;page one
set %shady 308 ;page one
set %copy 165 ;page two
set %brzy 200 ;page two
set %goldy 234 ;page two
set %agay 270 ;page two
set %very 305 ;page two
set %valy 166 ;page three
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;Brit Leather Locations;;;;;;;;;;;;;;;;;;;;;
Set %regulary 265 ;page 4
set %spinedy 304 ;page 4
set %scolor 2220
set %hornedy 168 ;page 5
set %hcolor 2117
set %barby 206 ;page 5
set %bcolor 2129
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;Vesper locations for wood and pages;;;;;;;;;;;;;;;
set %vwy 240 ; 2nd page
set %voy 274 ; 2nd page
set %vay 307 ; 2nd page
set %vyy 166 ; 2nd page
set %vhy 201 ; 2nd page
set %vby 235 ; 3rd page
set %vfy 268 ; 3rd page
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;
set %fishy 306 ;2nd page
set %scale 196 ;2nd page
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
set %genx 39
set %nx 308
set %ny 344
set %cont 345_359
set %wood TLK
set %ingots ENK
set %leather JJG
gosub showEUOMenu1
menu get rail
if #menures = #true
set %userail #true
menu get runebook
set %bookname #menures
menu get homeone
set %secure1 #menures
menu get hometwo
set %secure2 #menures
menu get donationone
set %donation1 #menures
menu get donationtwo
set %donation2 #menures
gosub openup
menu get what
if #menures = 1
set %donatingthis wood
if #menures = 2
set %donatingthis ingots
if #menures = 3
set %donatingthis fish
if #menures = 4
set %donatingthis scales
if #menures = 5
set %donatingthis leather
menu get where
if #menures = 1 && %donatingthis = ingots || #menures = 1 && %donatingthis = fish
|| #menures = 1 && %donatingthis = leather
{
Display Silly Rabbit... Vesper Doesn't Take These! Restart
halt
}
if #menures = 1
{
set %vesp #true
set %donatewood #true
set %containerid HKF
set %containerprop public
set %dragamountself %drag_wood_amount
set %dragamountpet 1600
set %itemtodonate TLK
}
if #menures = 2
{
set %containerbrit HS
menu get what
if #menures = 1
{
set %itemtogetnow Wood
set %brit #true
set %donatewood #true
set %containerid HS
set %containerprop artist
set %dragamountself %drag_wood_amount
set %dragamountpet 1600
set %itemtodonate TLK
}
if #menures = 2
{
set %itemtogetnow Ingots
set %brit #true
set %donateingots #true
set %containerid HS
set %containerprop trades
set %dragamountself %drag_ingot_amount
set %dragamountpet 16000
set %itemtodonate ENK
}
if #menures = 3
{
set %itemtogetnow Fish
set %brit #true
set %donatefish #true
set %containerid IS
set %containerprop fisher
set %dragamountself %drag_ingot_amount
set %dragamountpet 16000
set %itemtodonate IND
}
if #menures = 4
{
set %itemtogetnow Scales
set %brit #true
set %donatescales #true
set %containerid IS_HS
set %containerprop animal
set %dragamountself %drag_ingot_amount
set %dragamountpet 16000
set %itemtodonate STO
}
if #menures = 5
{
set %itemtogetnow Leather
set %brit #true
set %donateleather #true
set %containerid HS
set %containerprop trades
set %dragamountself %drag_wood_amount
set %dragamountpet 1600
set %itemtodonate JJG
}
}
if %bank = #true
{
event macro 3 0 bank
wait 60
set %bankbox #contid
display Target Your Secure!
wait 1
set #targcurs 1
target
while #targcurs = 1
wait 0
set %secure #ltargetid
set #lobjectid %secure
event macro 17
wait 20
}
if %home = #true
{
display Target Your Secure With the %itemtogetnow in it!
wait 1
set #targcurs 1
target
while #targcurs = 1
wait 0
set %secure #ltargetid
set #lobjectid %secure
event macro 17
wait 20
}
finditem %itemtodonate c_ , %secure
exevent drag #findid %dragamountself
wait 10
exevent dropc #backpackid
wait 20
finditem %itemtodonate c_ , %secure
exevent drag #findid %dragamountpet
wait 10
exevent dropc %packie
wait 20
gosub TM_TravelFromNamedRunebook %travel %donation1 %donation2 %bookname
wait 30
if %userail = #true
gosub rail
return
sub openup
menu get animal
if #menures = 1
{
set #lobjectid #charid
event macro 17
wait 40
event macro 3 0 all follow me
finditem ZGB g_2
set %packie #findid
exevent popup #findid
wait 20
set %clickx #CONTPOSX + 50 ;clicks to open beetle pack
set %clicky #CONTPOSY + 183
click %clickx %clicky f
set %contid #contid
}
if #menures = 2
{
relook:
finditem BO_WN g_2
if #findkind = -1
{
event macro 3 0 all follow me
goto relook
}
set %packie #findid
set #lobjectid #findid
event macro 17
wait 20
set %contid #contid
}
return
;=====================================================================
; %1 = Method (RE, GA, SJ)
; %2 = Object Findid
; returns #TRUE if error, #FALSE for no error
set !castretry 0
set !temp_ltargetid #LTARGETID
set !temp_ltargetkind #LTARGETKIND
NewCastSpell_loop1:
if !castretrymax < 0
goto NewCastSpell_cont1
if !castretry > !castretrymax
goto NewCastSpell_end1
NewCastSpell_cont1:
gosub TM_SyncTextScan
set #LTARGETKIND 1
set #LTARGETID !whichtarget
set !tempmana #MANA
event macro 15 !whichspell ; cast the spell
wait !waitdelay
set !targettimeout #SCNT + 7
NewCastSpell_wait1:
gosub TM_FindValidTextNoAdvance spell_fizzles you_have_not_yet mana
your_spirit more_reagents
if #RESULT = #TRUE || #SCNT > !targettimeout
{
set !casttimeout #SCNT2 + !recovery_delay
repeat
until #SCNT2 > !casttimeout ; finish up cast delay
set !castretry !castretry + 1
goto NewCastSpell_loop1
}
if !whichtarget = NONE
goto NewCastSpell_skip1
if #TARGCURS = 1
goto NewCastSpell_targ1
goto NewCastSpell_wait1 ; wait for target cursor
NewCastSpell_targ1:
if !whichtarget = SELF
event macro 23
else
event macro 22
NewCastSpell_skip1:
wait 5
set !casttimeout #SCNT2 + !recovery_delay
NewCastSpell_skip2:
if !whichspell >= 0 && !whichspell <= 63 ; Magery
{
gosub TM_FindValidTextNoAdvance spell_fizzles there_is_already mana
your_spirit more_reagents
}
else
{
set !cont #FALSE ; Chivalry, Necromancy, etc
finditem !whichtarget *
if !whichtarget in SELF_NONE || #FINDKIND <> -1
set !cont #TRUE
if #MANA >= !tempmana && !cont = #TRUE ; check if target is still there
set #RESULT #TRUE
else
set #RESULT #FALSE
}
repeat
until #SCNT2 > !casttimeout ; finish up cast delay
if #RESULT = #TRUE
{
if !castretrymax > -1
{
set !castretry !castretry + 1 ; %castretrymax of -1 will cast until
successful
if !castretry > !castretrymax
goto NewCastSpell_end1
}
goto NewCastSpell_loop1
}
if #SCNT2 <= !casttimeout ; finish up cast delay
goto NewCastSpell_skip2
NewCastSpell_end1:
set #LTARGETID !temp_ltargetid
set #LTARGETKIND !temp_ltargetkind
set #LPC !lpc
namespace pop
return
;-------------------------------------------------------------------------------
; %1 = Method (RE, GA, SJ)
; %2 = index location within runebook (1-16)
; %3 = index location within runebook (1-16), try up to this point
; %4 = runebook item id
; returns #TRUE if error, #FALSE for no error
sub TM_TravelFromRunebook
namespace push
namespace local RFR
set #LTARGETKIND 1
set !method %1
set !locindex %2
set !locindexend %3
set !rbook %4
TravelFromRunebook_loop1:
set #LOBJECTID !rbook
set #LTARGETKIND 1
event macro 17 0
gosub GumpWait generic_gump generic_gump
if !method = SJ
gosub TM_NewCastSpell 210 !rbook -1 40 60 ; sacred journey until successful
wait 30
if !method = SJ
gosub TM_NewCastSpell 210 !object -1 10 30 ; sacred journey until successful
wait 30
sub rail
if %vesp = #true
{
repeat
event pathfind 2923 968
until #charposx = 2923 && #charposy = 968
repeat
event pathfind 2926 969
until #charposx = 2926 && #charposy = 969
repeat
event pathfind 2925 974
until #charposx = 2925 && #charposy = 974
return
}
repeat
event pathfind 1419 1597
until #charposx = 1419 && #charposy = 1597
if %donateingots = #true
{
repeat
event pathfind 1410 1599
until #charposx = 1410 && #charposy = 1599
repeat
event pathfind 1411 1602
until #charposx = 1411 && #charposy = 1602
repeat
event pathfind 1415 1604
until #charposx = 1415 && #charposy = 1604
return
}
repeat
event pathfind 1416 1594
until #charposx = 1416 && #charposy = 1594
repeat
event pathfind 1411 1592
until #charposx = 1411 && #charposy = 1592
repeat
event pathfind 1414 1589
until #charposx = 1414 && #charposy = 1589
if %containerprop = trades
return
repeat
event pathfind 1409 1589
until #charposx = 1409 && #charposy = 1589
repeat
event pathfind 1409 1593
until #charposx = 1409 && #charposy = 1593
repeat
event pathfind 1413 1594
until #charposx = 1413 && #charposy = 1594
if %containerprop = animal
return
repeat
event pathfind 1413 1605
until #charposx = 1413 && #charposy = 1605
repeat
event pathfind 1411 1607
until #charposx = 1411 && #charposy = 1607
return