Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;set %AtCove #False
- ;gosub DetermineVendor
- ;halt
- set %sound C:\Users\Alarms\alarm.mp3
- set %PlaySound #False
- ;************************ ITEM BUY SELECTION MENU **************************
- menu Clear
- menu Window Size 250 200
- menu Show
- menu Font Size 12
- menu Font Style b
- menu Text txtTitle 5 5 Bob Ross' Reagent Buyer
- menu Font Size 10
- menu Font Style
- menu Text txtInstructions 5 30 Select the items you want to buy:
- menu Check chkBlackPearl 5 50 100 25 #false Black Pearl
- menu Check chkBloodMoss 5 70 100 25 #false Blood Moss
- menu Check chkGarlic 5 90 100 25 #false Garlic
- menu Check chkGinseng 5 110 100 25 #false Ginseng
- menu Check chkMandrakeRoot 5 130 120 25 #false Mandrake Root
- menu Check chkNightshade 135 50 100 25 #false Nightshade
- menu Check chkSpiderSilk 135 70 100 25 #false Spider's Silk
- menu Check chkSulphurousAsh 135 90 120 25 #false Sulphurous Ash
- menu Font Style i
- menu Check chkEmptyBottles 135 110 120 25 #false Empty Bottles
- menu Check chkLesserPoisons 135 130 120 25 #false Lesser Poisons
- menu Font Style
- menu Font Size 12
- menu Button btnStart 80 160 75 30 Start
- set %CompareString
- MENULOOP:
- if #MenuButton <> btnStart
- {
- wait 5
- goto MENULOOP
- }
- else
- {
- gosub MenuResults
- }
- wait 1s
- ;*************** VARIABLE INITALIZATION ******************
- set %counter 0
- set %AtCove #false
- set %OpenDoor #false
- set %SecondMage #false
- set %PathFindWait 3
- set %BuyCount 0
- set %PageNumber 1
- set %ReagentStorage
- set %DropOff #false
- set %OverWeightDrop #false
- set %HomeRune
- set %RegPouch
- set %RuneBook
- set %NextGump
- set %RUNEBOOKGUMP WZQC
- set %INITBUYGUMP WZQC
- set %BILLGUMP GZE
- set %GUMPTIMEOUT 5
- set %RECALLTIMEOUT 10
- ;***********************************************************
- ;Find our home recall rune, reg pouch and runebook to vendors.
- set %temp C_
- str Ins %temp #BACKPACKID 3
- findItem QWL #strRes
- if #FindCnt > 1
- {
- Event Sysmessage Select Home Rune now!
- set #TARGCURS 1
- Repeat
- Until #TARGCURS = 0
- set %HomeRune #lTargetID
- }
- else
- set %HomeRune #findID
- findItem CKF #strRes
- set %RegPouch #findID
- ;We must differentiate between the rune book and a spellbook
- set %fIndex 1
- FINDRUNEBOOKLOOP:
- findItem MPF %fIndex #strRes
- if #findCnt > 0
- {
- if #findCol = 542
- {
- set %RuneBook #findID
- }
- else
- {
- if %fIndex <= 2
- {
- set %fIndex %fIndex + 1
- goto FINDRUNEBOOKLOOP
- }
- else
- {
- event SysMessage No rune book found! Stopping script!
- halt
- }
- }
- }
- else
- {
- event SysMessage No rune book found! Stopping script!
- halt
- }
- event SysMessage Home rune found: %HomeRune
- event SysMessage Reg pouch found: %RegPouch
- event SysMessage Rune book found: %RuneBook
- event SysMessage :
- event SysMessage :
- ;Get the id of the chest where we'll dump reagents.
- event SysMessage DOUBLE CLICK on the container for storing reagents. (You should use a metal chest.)
- gosub GetChest
- MAINLOOP:
- gosub CheckWeight
- if %OverWeightDrop = #false
- {
- gosub Recall
- }
- else
- {
- set %OverWeightDrop #false
- }
- if %DropOff = #false
- {
- gosub DetermineVendor
- }
- else
- {
- set %DropOff #false
- }
- goto MAINLOOP
- ;********************* sub GetChest - This subroutine retrieves and stores the ID for the
- ;********************* chest/container used for permanent storage of regs.
- sub GetChest
- set #LOBJECTID UAZZTDF
- set %StoredObjectID #LOBJECTID
- CHESTLISTENLOOP:
- if #LOBJECTID <> %StoredObjectID
- {
- set %ReagentStorage #LOBJECTID
- event SysMessage Reagent storage container chosen: %ReagentStorage
- }
- else
- {
- goto CHESTLISTENLOOP
- }
- return
- ;********************* sub Recall - This subroutine turns to the correct page in the rune book
- ;********************* and recalls to that location.
- sub Recall
- ;If we are finished with a full book, we need to store the reagents.
- if %PageNumber = 9 && %BuyCount = 16
- {
- gosub StoreRegs
- set %PageNumber 1
- set %BuyCount 0
- }
- else
- {
- ;Open the runebook.
- set #LOBJECTID %RuneBook
- event Macro 17 0
- ;wait 4s
- set %NextGump %RUNEBOOKGUMP
- gosub WaitForGump
- ;Turn to the right page.
- set %x 0
- TURNLOOP:
- if %x < %PageNumber
- {
- click 335 20 ;Turn the page.
- wait 5
- set %x %x + 1
- goto TURNLOOP
- }
- else ;We are on the correct page.
- {
- if %BuyCount % 2 = 0
- {
- click 87 173 ;Left Page
- }
- else
- {
- click 253 173 ;Right Page
- }
- }
- }
- gosub RecallWait
- return
- ;********************* sub BuyRegs - This subroutine pathfinds to a vendor and buys chosen items.
- sub BuyRegs
- if #findCnt > 0 && %AtCove = #false
- {
- If #FindDist > 3 2
- set %pathfind #True
- event PathFind #findX #findY #findZ
- if %OpenDoor = #true ;This only happens at the Occlo mages.
- {
- set %VendorX #findX
- set %VendorY #findY
- set %VendorZ #findZ
- set %VendorID #findID
- findItem QULRJMD G_10
- event PathFind #findX #findY #findZ
- wait 3s
- set #lObjectID #FindID
- Event Macro 17
- ;click 334 222 d
- wait 2s
- event PathFind %VendorX %VendorY %VendorZ
- wait 3s
- set #LOBJECTID %VendorID
- }
- else ;This is where most vendors are dealt with. The others are exceptional cases.
- {
- set %PathFindCounter 0
- PATHFINDWAITLOOP:
- wait 1s
- set %PathFindCounter %PathFindCounter + 1
- if %PathFindCounter < %PathFindWait && ( #CHARPOSX <> #findX || #CHARPOSY <> #findY ) && %pathfind = #True
- {
- goto PATHFINDWAITLOOP
- }
- set #LOBJECTID #findID
- set %pathfind #False
- }
- }
- else
- {
- if %SecondMage = #false
- {
- set #LOBJECTID #findID
- }
- else
- {
- event PathFind #findX #findY #findZ
- wait 3s
- set %SecondMage #false
- }
- }
- event Macro 17 0
- set %NextGump %INITBUYGUMP
- gosub WaitForGump
- click 75 140
- set %NextGump %BILLGUMP
- gosub WaitForGump
- BUYLOOP:
- click 200 20
- getShopInfo
- if #SHOPITEMNAME in %CompareString
- {
- click 249 87 d
- click 249 87 d
- set %counter %counter + 1
- ;wait 5
- setShopItem #SHOPITEMID #SHOPITEMMAX
- }
- if #SHOPCURPOS = #SHOPCNT || %counter = %_counter
- {
- click 364 426
- set %counter 0
- return
- }
- else
- {
- click 391 204
- ;wait 5
- goto BUYLOOP
- }
- return
- ;********************* sub CheckWeight - This subroutine monitors weight. If you are overweight,
- ;********************* it will go home to unload and continue buying.
- sub CheckWeight
- if #WEIGHT > 380
- {
- event SysMessage You are overweight!
- gosub StoreRegs
- wait 2s
- set %OverWeightDrop #true
- }
- if #GOLD < 30000
- {
- event SysMessage You are poor as fuck!
- gosub StoreRegs
- wait 2s
- set %OverWeightDrop #true
- }
- return
- ;********************* sub WaitForGump - This subroutine pauses execution of the script
- ;********************* until a specified gump appears.
- sub WaitForGump
- set %GumpTimer 0
- GUMPWAITLOOP:
- if #CONTKIND <> %NextGump && %GumpTimer < %GUMPTIMEOUT
- {
- set %GumpTimer %GumpTimer + 1
- wait 1s
- goto GUMPWAITLOOP
- }
- return
- ;********************* sub RecallWait - This subroutine pauses execution of the script
- ;********************* until a character has recalled to a different location.
- sub RecallWait
- set %RecallTimer 0
- set %PreRecallX #CHARPOSX
- set %PreRecallY #CHARPOSY
- RECALLWAITLOOP:
- if #CHARPOSX = %PreRecallX && #CHARPOSY = %PreRecallY && %RecallTimer < %RECALLTIMEOUT
- {
- set %RecallTimer %RecallTimer + 1
- wait 1s
- goto RECALLWAITLOOP
- }
- return
- ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
- ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
- ;@@@@@@@@@@@@@@@@@@@@@@@ THESE SUBROUTINES ARE RELATIVELY STATIC @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
- ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
- ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
- ;******************** sub MenuResults - This subroutine handles the results of the inital menu.
- ;******************** It builds a string to compare item names with in the buy
- ;******************** menu. It stores this in %CompareString
- sub MenuResults
- set %_counter 0
- menu Get chkBlackPearl
- if #menures = #true
- {
- set %StringAddition black_pearl_
- str Len %CompareString
- set %strLen #strRes + 1
- str Ins %CompareString %StringAddition %strLen
- set %CompareString #strRes
- set %_counter %_counter + 1
- }
- menu Get chkBloodMoss
- if #menures = #true
- {
- set %StringAddition blood_moss_
- str Len %CompareString
- set %strLen #strRes + 1
- str Ins %CompareString %StringAddition %strLen
- set %CompareString #strRes
- set %_counter %_counter + 1
- }
- menu Get chkGarlic
- if #menures = #true
- {
- set %StringAddition garlic_
- str Len %CompareString
- set %strLen #strRes + 1
- str Ins %CompareString %StringAddition %strLen
- set %CompareString #strRes
- set %_counter %_counter + 1
- }
- menu Get chkGinseng
- if #menures = #true
- {
- set %StringAddition ginseng_
- str Len %CompareString
- set %strLen #strRes + 1
- str Ins %CompareString %StringAddition %strLen
- set %CompareString #strRes
- set %_counter %_counter + 1
- }
- menu Get chkMandrakeRoot
- if #menures = #true
- {
- set %StringAddition mandrake_root_
- str Len %CompareString
- set %strLen #strRes + 1
- str Ins %CompareString %StringAddition %strLen
- set %CompareString #strRes
- set %_counter %_counter + 1
- }
- menu Get chkNightshade
- if #menures = #true
- {
- set %StringAddition nightshade_
- str Len %CompareString
- set %strLen #strRes + 1
- str Ins %CompareString %StringAddition %strLen
- set %CompareString #strRes
- set %_counter %_counter + 1
- }
- menu Get chkSpiderSilk
- if #menures = #true
- {
- set %StringAddition spider's_silk_
- str Len %CompareString
- set %strLen #strRes + 1
- str Ins %CompareString %StringAddition %strLen
- set %CompareString #strRes
- set %_counter %_counter + 1
- }
- menu Get chkSulphurousAsh
- if #menures = #true
- {
- set %StringAddition sulphurous_ash_
- str Len %CompareString
- set %strLen #strRes + 1
- str Ins %CompareString %StringAddition %strLen
- set %CompareString #strRes
- set %_counter %_counter + 1
- }
- menu Get chkEmptyBottles
- if #menures = #true
- {
- set %StringAddition empty_bottle_
- str Len %CompareString
- set %strLen #strRes + 1
- str Ins %CompareString %StringAddition %strLen
- set %CompareString #strRes
- set %_counter %_counter + 1
- }
- menu Get chkLesserPoisons
- if #menures = #true
- {
- set %StringAddition lesser_poison_potion_
- str Len %CompareString
- set %strLen #strRes + 1
- str Ins %CompareString %StringAddition %strLen
- set %CompareString #strRes
- set %_counter %_counter + 1
- }
- menu Hide
- return
- ;******************** sub StoreRegs - This subroutine recalls home and transfers all regs from
- ;******************** your pouch to permanent storage. The id of the permanent
- ;******************** storage container is saved in %ReagentStorage
- sub StoreRegs
- if %PlaySound && %PageNumber = 9 && %BuyCount = 16
- execute %sound
- event Macro 15 30
- target 6s
- set #LTARGETID %HomeRune
- event Macro 22 0
- wait 2s
- ;Open our pouch
- set #LOBJECTID %RegPouch
- event Macro 17 0
- wait 2s
- contPos 400 400
- set %temp C_
- str Ins %temp %RegPouch 3
- findItem RZF #strRes ;spider's silk
- if #findCnt > 0
- {
- set %StackSize #findStack - 50
- exevent Drag #findID %StackSize
- exevent Dropc %ReagentStorage
- }
- findItem KUF #strRes ;black pearl
- if #findCnt > 0
- {
- set %StackSize #findStack - 50
- exevent Drag #findID %StackSize
- exevent Dropc %ReagentStorage
- }
- findItem JZF #strRes ;ginseng
- if #findCnt > 0
- {
- set %StackSize #findStack - 50
- exevent Drag #findID %StackSize
- exevent Dropc %ReagentStorage
- }
- findItem JUF #strRes ;blood moss
- if #findCnt > 0
- {
- set %StackSize #findStack - 50
- exevent Drag #findID %StackSize
- exevent Dropc %ReagentStorage
- }
- findItem SZF #strRes ;sulphurous ash
- if #findCnt > 0
- {
- set %StackSize #findStack - 50
- exevent Drag #findID %StackSize
- exevent Dropc %ReagentStorage
- }
- findItem KZF #strRes ;garlic
- if #findCnt > 0
- {
- set %StackSize #findStack - 50
- exevent Drag #findID %StackSize
- exevent Dropc %ReagentStorage
- }
- findItem MZF #strRes ;mandrake root
- if #findCnt > 0
- {
- set %StackSize #findStack - 50
- exevent Drag #findID %StackSize
- exevent Dropc %ReagentStorage
- }
- findItem WZF #strRes ;nightshade
- if #findCnt > 0
- {
- set %StackSize #findStack - 50
- exevent Drag #findID %StackSize
- exevent Dropc %ReagentStorage
- }
- ;Last we need to search for bottles or lesser poisons in the main backpack
- set %temp C_
- str Ins %temp #BACKPACKID 3
- findItem WUF #strRes ;empty bottles
- if #findCnt > 0
- {
- exevent Drag #findID #findStack
- exevent Dropc %ReagentStorage
- }
- findItem AVF #strRes ;lesser poisons
- if #findCnt > 0
- {
- exevent Drag #findID #findStack
- exevent Dropc %ReagentStorage
- }
- set %DropOff #true
- wait 5
- if #GOLD < 60000
- {
- finditem %ReagentStorage G_2
- wait 5
- if #findkind <> -1
- {
- set #lobjectid #findid
- event macro 17
- wait 15
- }
- finditem POF C_ , %ReagentStorage
- wait 5
- Exevent drag #findid 60000
- wait 5
- Exevent dropc #backpackid
- }
- return
- ;******************** sub MoveRegs - This subroutine transfers all regs from your backpack to
- ;******************** your pouch after buying from all vendors at a location.
- sub MoveRegs
- set %temp C_
- str Ins %temp #BACKPACKID 3
- set %MyBackpack #strRes
- findItem RZF %MyBackpack ;spider's silk
- if #findCnt > 0
- {
- exevent Drag #findID #findStack
- exevent Dropc %RegPouch
- }
- findItem KUF %MyBackpack ;black pearl
- if #findCnt > 0
- {
- exevent Drag #findID #findStack
- exevent Dropc %RegPouch
- }
- findItem JZF %MyBackpack ;ginseng
- if #findCnt > 0
- {
- exevent Drag #findID #findStack
- exevent Dropc %RegPouch
- }
- findItem JUF %MyBackpack ;blood moss
- if #findCnt > 0
- {
- exevent Drag #findID #findStack
- exevent Dropc %RegPouch
- }
- findItem SZF %MyBackpack ;sulphurous ash
- if #findCnt > 0
- {
- exevent Drag #findID #findStack
- exevent Dropc %RegPouch
- }
- findItem KZF %MyBackpack ;garlic
- if #findCnt > 0
- {
- exevent Drag #findID #findStack
- exevent Dropc %RegPouch
- }
- findItem MZF %MyBackpack ;mandrake root
- if #findCnt > 0
- {
- exevent Drag #findID #findStack
- exevent Dropc %RegPouch
- }
- findItem WZF %MyBackpack ;nightshade
- if #findCnt > 0
- {
- exevent Drag #findID #findStack
- exevent Dropc %RegPouch
- }
- return
- ;******************** sub Buy_____ - This block contains subroutines for buying regs from vendors
- ;******************** at a specific location. Any location specific modifications
- ;******************** should be placed here. Any new vendor location must have a
- ;******************** correspnding subroutine here.
- sub BuyYewRegs
- ;Buy from Vendors
- set %PathFindWait 4
- findItem LED G_20 ;Marcin the mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem MED G_20 ;Kuba the mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem RED G_20 ;Konrad the mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem OED G_20 ;Iria the alchemist
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- ;Put regs in a pouch
- gosub MoveRegs
- return
- sub BuyMerlinRegs
- set %PathFindWait 5
- ;Buy from vendors.
- findItem OXX G_20 ;Adrian, Merlin's Disciple
- if #FindKind <> -1
- gosub BuyRegs
- findItem OXMBB G_20 ;Merlin the High Wizard
- if #FindKind <> -1
- gosub BuyRegs
- set %PathFindWait 10
- event pathFind 3760 2105 20
- findItem ZZX G_30 ;A Merlin's Disciple
- if #FindKind <> -1
- gosub BuyRegs
- findItem FAY G_30 ;A Merlin's Disciple
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyMaginciaWestRegs
- set %PathFindWait 4
- findItem ROHC G_20 ;Geo the Mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem SOHC G_20 ;Benny the Mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem LIGD G_20 ;Jeanett the Alchemist
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyMaginciaEastRegs
- set %PathFindWait 5
- findItem AQI G_20 ;Raymond the Mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem ZPI G_20 ;Vlad the Mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem CQI G_20 ;Gord the Mage
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyBritWestRegs
- set %PathFindWait 4
- findItem NYC G_20 ;Nicholas the mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem OYC G_20 ;Kent the mage
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyBritEastRegs
- set %PathFindWait 3
- findItem ZEDC ;Lumpour the Alchemist
- if #FindKind <> -1
- gosub BuyRegs
- findItem OEDC ;Lisa the mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem SGPF ;Danica the mage
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyBritSouthRegs
- set %PathFindWait 3
- findItem XXC ; Spock the al
- if #FindKind <> -1
- gosub BuyRegs
- findItem YXC ; Kirk the herbalist
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyTrinsicSouthRegs
- set %PathFindWait 3
- findItem BHD ;Twardy the mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem CHD ;Lizawka the alch
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyTrinsicNorthRegs
- set %PathFindWait 3
- findItem SGD ; Chmielu the mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem RGD ;Marty the mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem QGD ;Blazej the alchemist
- if #FindKind <> -1
- gosub BuyRegs
- findItem PGD ; Dorota the mage
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyCoveRegs
- set %PathFindWait 4
- set %AtCove #true
- findItem NDD ;Anne the mage
- if #FindKind <> -1
- gosub BuyRegs
- set %SecondMage #true
- findItem ODD ;Ned the herbalist
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- set %AtCove #false
- set %SecondMage #false
- return
- sub BuyJhelomSouthRegs
- set %PathFindWait 3
- findItem DBG G_20 ;Damien the Mage
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyJhelomNorthRegs
- set %PathFindWait 3
- findItem YAG G_20 ;Abra the Mage
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyJhelomDocksRegs
- set %PathFindWait 2
- findItem BAYWD G_20 ;Hogwart the Witch
- if #FindKind <> -1
- gosub BuyRegs
- findItem CAYWD G_20 ;Mildred the Witch
- if #FindKind <> -1
- gosub BuyRegs
- findItem WZXWD G_20 ;Drathmore the Mage
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuySouthJhelomIslandRegs
- set %PathFindWait 3
- findItem PAG G_20 ;Melissa the Mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem SAG G_20 ;Eli the Mage
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyMoonglowNorthRegs
- set %PathFindWait 5
- findItem PMD ;Claire the mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem SMD ;Chris the mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem RMD ;pencer the mage
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyMoonglowSouthRegs
- set %PathFindWait 3
- findItem NMD ;Zolta the alchemist
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyMoonglowSouthAlchemistRegs
- set %PathFindWait 3
- findItem AXF G_20 ;Todd the Alchemist
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyOccloRegs
- set %PathFindWait 5
- findItem CYF G_20 ;Tommie the Mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem BYF G_20 ;Jeff the Alchemist
- if #FindKind <> -1
- gosub BuyRegs
- findItem ZSFC G_20 ;Frida the Mage
- if #FindKind <> -1
- set %OpenDoor #true
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- set %OpenDoor #false
- return
- sub BuySkaraBraeRegs
- set %PathFindWait 4
- findItem OND ;Bob the mage
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuySkaraBraeNorthRegs
- set %PathFindWait 3
- findItem GID ;Siwa the alchemist
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyVesperSouthRegs
- set %PathFindWait 5
- findItem KBD ;Amen the mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem JBD ;Lucy the mage
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyVesperNorthRegs
- set %PathFindWait 4
- findItem QBD ;Ben the mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem PBD ;Troy the alchemist
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyVesperSoutheastRegs
- set %PathFindWait 3
- findItem VBD ;Bayu the lachemist
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyMinocAlchemistRegs
- set %PathFindWait 2
- findItem WBJ G_20 ;Sonya the Alchemist
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyMinocGypsyMageRegs
- set %PathFindWait 3
- findItem KYDC ;Battousai the alchemist
- if #FindKind <> -1
- gosub BuyRegs
- findItem JYDC ;Decius the mage
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyNuJelmMageRegs
- set %PathFindWait 5
- findItem ZTG G_20 ;Fredrica the Mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem AUG G_20 ;Otto the Mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem CUG G_20 ;Avian the Mage
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyNuJelmAlchemistRegs
- set %PathFindWait 5
- findItem OUIHB G_20 ;Alchemist 1
- if #FindKind <> -1
- gosub BuyRegs
- findItem IUIHB G_20 ;Alchemist 2
- if #FindKind <> -1
- gosub BuyRegs
- findItem LUIHB G_20 ;Alchemist 3
- if #FindKind <> -1
- gosub BuyRegs
- findItem NUIHB G_20 ;Alchemist 3
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- sub BuyMinocRegs
- set %PathFindWait 5
- findItem ABD ;Nelson the mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem TAD ;Ophelia the alchemist
- if #FindKind <> -1
- gosub BuyRegs
- findItem ZAD ;Thomas the mage
- if #FindKind <> -1
- gosub BuyRegs
- findItem UAD ;Nancy the herbalist
- if #FindKind <> -1
- gosub BuyRegs
- wait 2s
- gosub MoveRegs
- return
- ;******************** sub DetermineVendor - This subroutine uses the #CHARPOSX, #CHARPOSY to determine
- ;******************** which vendor location you are at. If any new vendors are
- ;******************** are added, their location boundaries must be added here.
- sub DetermineVendor
- if #CHARPOSX <= 3720 && #CHARPOSX >= 3678 && #CHARPOSY <= 2231 && #CHARPOSY >= 2190
- {
- event SysMessage You are in Magincia West!
- gosub BuyMaginciaWestRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 3784 && #CHARPOSX >= 3747 && #CHARPOSY <= 2129 && #CHARPOSY >= 2093
- {
- event SysMessage You are in Merlin's!
- gosub BuyMerlinRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 630 && #CHARPOSX >= 624 && #CHARPOSY <= 846 && #CHARPOSY >= 832
- {
- event SysMessage You are in Yew!
- gosub BuyYewRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 3808 && #CHARPOSX >= 3777 && #CHARPOSY <= 2272 && #CHARPOSY >= 2233
- {
- event SysMessage You are in Magincia East!
- gosub BuyMaginciaEastRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 1498 && #CHARPOSX >= 1484 && #CHARPOSY <= 1558 && #CHARPOSY >= 1544
- {
- event SysMessage You are in Brit West!
- gosub BuyBritWestRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 1598 && #CHARPOSX >= 1584 && #CHARPOSY <= 1662 && #CHARPOSY >= 1648
- {
- event SysMessage You are in Brit East!
- gosub BuyBritEastRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 1506 && #CHARPOSX >= 1496 && #CHARPOSY <= 1666 && #CHARPOSY >= 1656
- {
- event SysMessage You are in Brit South!
- gosub BuyBritSouthRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 1850 && #CHARPOSX >= 1837 && #CHARPOSY <= 2708 && #CHARPOSY >= 2701
- {
- event SysMessage You are in Trinsic South!
- gosub BuyTrinsicSouthRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 1861 && #CHARPOSX >= 1844 && #CHARPOSY <= 2686 && #CHARPOSY >= 2673
- {
- event SysMessage You are in Trinsic North!
- gosub BuyTrinsicNorthRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 2286 && #CHARPOSX >= 2280 && #CHARPOSY <= 1230 && #CHARPOSY >= 1224
- {
- event SysMessage You are in Cove!
- gosub BuyCoveRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 1462 && #CHARPOSX >= 1456 && #CHARPOSY <= 3830 && #CHARPOSY >= 3816
- {
- event SysMessage You are in Jhelom South!
- gosub BuyJhelomSouthRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 1462 && #CHARPOSX >= 1456 && #CHARPOSY <= 3806 && #CHARPOSY >= 3792
- {
- event SysMessage You are in Jhelom North!
- gosub BuyJhelomNorthRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 1382 && #CHARPOSX >= 1376 && #CHARPOSY <= 3854 && #CHARPOSY >= 3848
- {
- event SysMessage You are in Jhelom Docks!
- gosub BuyJhelomDocksRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 1430 && #CHARPOSX >= 1419 && #CHARPOSY <= 3990 && #CHARPOSY >= 3976
- {
- event SysMessage You are in South Jhelom Island!
- gosub BuySouthJhelomIslandRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 4463 && #CHARPOSX >= 4447 && #CHARPOSY <= 1094 && #CHARPOSY >= 1080
- {
- event SysMessage You are in Moonglow North!
- gosub BuyMoonglowNorthRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 4422 && #CHARPOSX >= 4408 && #CHARPOSY <= 1115 && #CHARPOSY >= 1108
- {
- event SysMessage You are in Moonglow North Alchemist!
- gosub BuyMoonglowSouthRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 4422 && #CHARPOSX >= 4408 && #CHARPOSY <= 1142 && #CHARPOSY >= 1129
- {
- event SysMessage You are in Moonglow South Alchemist!
- gosub BuyMoonglowSouthAlchemistRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 3630 && #CHARPOSX >= 3624 && #CHARPOSY <= 2550 && #CHARPOSY >= 2536
- {
- event SysMessage You are in Occlo!
- gosub BuyOccloRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 611 && #CHARPOSX >= 600 && #CHARPOSY <= 2182 && #CHARPOSY >= 2176
- {
- event SysMessage You are in Skara Brae South!
- gosub BuySkaraBraeRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 670 && #CHARPOSX >= 656 && #CHARPOSY <= 2142 && #CHARPOSY >= 2136
- {
- event SysMessage You are in Skara Brae North!
- gosub BuySkaraBraeNorthRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 2926 && #CHARPOSX >= 2912 && #CHARPOSY <= 678 && #CHARPOSY >= 664
- {
- event SysMessage You are in Vesper South!
- gosub BuyVesperSouthRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 2892 && #CHARPOSX >= 2883 && #CHARPOSY <= 654 && #CHARPOSY >= 648
- {
- event SysMessage You are in Vesper North!
- gosub BuyVesperNorthRegs
- set %VendorFound #true
- }
- ;if #CHARPOSX <= 2998 && #CHARPOSX >= 2992 && #CHARPOSY <= 846 && #CHARPOSY >= 832
- if #CHARPOSX <= 2910 && #CHARPOSX >= 2904 && #CHARPOSY <= 718 && #CHARPOSY >= 704
- {
- event SysMessage You are in Vesper Southeast!
- gosub BuyVesperSoutheastRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 2552 && #CHARPOSX >= 2546 && #CHARPOSY <= 659 && #CHARPOSY >= 650
- {
- event SysMessage You are in Minoc Alchemist!
- ;gosub BuyMinocAlchemistRegs
- gosub BuyMinocGypsyMageRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 2520 && #CHARPOSX >= 2514 && #CHARPOSY <= 659 && #CHARPOSY >= 650
- {
- event SysMessage You are in Minoc Gypsy Mage!
- gosub BuyMinocGypsyMageRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 3782 && #CHARPOSX >= 3760 && #CHARPOSY <= 1206 && #CHARPOSY >= 1184
- {
- event SysMessage You are in Nu'Jelm Mage!
- gosub BuyNuJelmMageRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 3702 && #CHARPOSX >= 3688 && #CHARPOSY <= 1271 && #CHARPOSY >= 1256
- {
- event SysMessage You are in Nu'Jelm Alchemist!
- gosub BuyNuJelmAlchemistRegs
- set %VendorFound #true
- }
- if #CHARPOSX <= 2465 && #CHARPOSX >= 2443 && #CHARPOSY <= 497 && #CHARPOSY >= 475
- {
- event SysMessage You are in Minoc!
- gosub BuyMinocRegs
- set %VendorFound #true
- }
- if %VendorFound = #true
- {
- set %BuyCount %BuyCount + 1
- if %BuyCount % 2 = 0
- {
- set %PageNumber %PageNumber + 1
- }
- }
- else
- {
- event SysMessage Unknown vendor! Going to the next vendor!
- set %BuyCount %BuyCount + 1
- if %BuyCount % 2 = 0
- {
- set %PageNumber %PageNumber + 1
- }
- }
- set %VendorFound #false
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement