Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.41 KB | None | 0 0
  1. ;set %AtCove #False
  2. ;gosub DetermineVendor
  3. ;halt
  4.  
  5. set %sound C:\Users\Alarms\alarm.mp3
  6. set %PlaySound #False
  7.  
  8. ;************************ ITEM BUY SELECTION MENU **************************
  9. menu Clear
  10. menu Window Size 250 200
  11. menu Show
  12. menu Font Size 12
  13. menu Font Style b
  14. menu Text txtTitle 5 5 Bob Ross' Reagent Buyer
  15. menu Font Size 10
  16. menu Font Style
  17. menu Text txtInstructions 5 30 Select the items you want to buy:
  18. menu Check chkBlackPearl 5 50 100 25 #false Black Pearl
  19. menu Check chkBloodMoss 5 70 100 25 #false Blood Moss
  20. menu Check chkGarlic 5 90 100 25 #false Garlic
  21. menu Check chkGinseng 5 110 100 25 #false Ginseng
  22. menu Check chkMandrakeRoot 5 130 120 25 #false Mandrake Root
  23.  
  24. menu Check chkNightshade 135 50 100 25 #false Nightshade
  25. menu Check chkSpiderSilk 135 70 100 25 #false Spider's Silk
  26. menu Check chkSulphurousAsh 135 90 120 25 #false Sulphurous Ash
  27. menu Font Style i
  28. menu Check chkEmptyBottles 135 110 120 25 #false Empty Bottles
  29. menu Check chkLesserPoisons 135 130 120 25 #false Lesser Poisons
  30.  
  31. menu Font Style
  32. menu Font Size 12
  33. menu Button btnStart 80 160 75 30 Start
  34. set %CompareString
  35.  
  36. MENULOOP:
  37. if #MenuButton <> btnStart
  38. {
  39. wait 5
  40. goto MENULOOP
  41. }
  42. else
  43. {
  44. gosub MenuResults
  45. }
  46. wait 1s
  47.  
  48. ;*************** VARIABLE INITALIZATION ******************
  49. set %counter 0
  50. set %AtCove #false
  51. set %OpenDoor #false
  52. set %SecondMage #false
  53. set %PathFindWait 3
  54.  
  55. set %BuyCount 0
  56. set %PageNumber 1
  57. set %ReagentStorage
  58.  
  59. set %DropOff #false
  60. set %OverWeightDrop #false
  61.  
  62. set %HomeRune
  63. set %RegPouch
  64. set %RuneBook
  65.  
  66. set %NextGump
  67. set %RUNEBOOKGUMP WZQC
  68. set %INITBUYGUMP WZQC
  69. set %BILLGUMP GZE
  70.  
  71. set %GUMPTIMEOUT 5
  72. set %RECALLTIMEOUT 10
  73. ;***********************************************************
  74.  
  75. ;Find our home recall rune, reg pouch and runebook to vendors.
  76. set %temp C_
  77. str Ins %temp #BACKPACKID 3
  78. findItem QWL #strRes
  79. if #FindCnt > 1
  80. {
  81. Event Sysmessage Select Home Rune now!
  82. set #TARGCURS 1
  83. Repeat
  84. Until #TARGCURS = 0
  85. set %HomeRune #lTargetID
  86. }
  87. else
  88. set %HomeRune #findID
  89. findItem CKF #strRes
  90. set %RegPouch #findID
  91.  
  92. ;We must differentiate between the rune book and a spellbook
  93. set %fIndex 1
  94. FINDRUNEBOOKLOOP:
  95. findItem MPF %fIndex #strRes
  96. if #findCnt > 0
  97. {
  98. if #findCol = 542
  99. {
  100. set %RuneBook #findID
  101. }
  102. else
  103. {
  104. if %fIndex <= 2
  105. {
  106. set %fIndex %fIndex + 1
  107. goto FINDRUNEBOOKLOOP
  108. }
  109. else
  110. {
  111. event SysMessage No rune book found! Stopping script!
  112. halt
  113. }
  114. }
  115. }
  116. else
  117. {
  118. event SysMessage No rune book found! Stopping script!
  119. halt
  120. }
  121. event SysMessage Home rune found: %HomeRune
  122. event SysMessage Reg pouch found: %RegPouch
  123. event SysMessage Rune book found: %RuneBook
  124. event SysMessage :
  125. event SysMessage :
  126.  
  127. ;Get the id of the chest where we'll dump reagents.
  128. event SysMessage DOUBLE CLICK on the container for storing reagents. (You should use a metal chest.)
  129. gosub GetChest
  130.  
  131. MAINLOOP:
  132. gosub CheckWeight
  133. if %OverWeightDrop = #false
  134. {
  135. gosub Recall
  136. }
  137. else
  138. {
  139. set %OverWeightDrop #false
  140. }
  141. if %DropOff = #false
  142. {
  143. gosub DetermineVendor
  144. }
  145. else
  146. {
  147. set %DropOff #false
  148. }
  149. goto MAINLOOP
  150.  
  151. ;********************* sub GetChest - This subroutine retrieves and stores the ID for the
  152. ;********************* chest/container used for permanent storage of regs.
  153. sub GetChest
  154. set #LOBJECTID UAZZTDF
  155. set %StoredObjectID #LOBJECTID
  156. CHESTLISTENLOOP:
  157. if #LOBJECTID <> %StoredObjectID
  158. {
  159. set %ReagentStorage #LOBJECTID
  160. event SysMessage Reagent storage container chosen: %ReagentStorage
  161. }
  162. else
  163. {
  164. goto CHESTLISTENLOOP
  165. }
  166. return
  167.  
  168. ;********************* sub Recall - This subroutine turns to the correct page in the rune book
  169. ;********************* and recalls to that location.
  170. sub Recall
  171. ;If we are finished with a full book, we need to store the reagents.
  172. if %PageNumber = 9 && %BuyCount = 16
  173. {
  174. gosub StoreRegs
  175. set %PageNumber 1
  176. set %BuyCount 0
  177. }
  178. else
  179. {
  180. ;Open the runebook.
  181. set #LOBJECTID %RuneBook
  182. event Macro 17 0
  183. ;wait 4s
  184. set %NextGump %RUNEBOOKGUMP
  185. gosub WaitForGump
  186. ;Turn to the right page.
  187. set %x 0
  188. TURNLOOP:
  189. if %x < %PageNumber
  190. {
  191. click 335 20 ;Turn the page.
  192. wait 5
  193. set %x %x + 1
  194. goto TURNLOOP
  195. }
  196. else ;We are on the correct page.
  197. {
  198. if %BuyCount % 2 = 0
  199. {
  200. click 87 173 ;Left Page
  201. }
  202. else
  203. {
  204. click 253 173 ;Right Page
  205. }
  206. }
  207. }
  208. gosub RecallWait
  209. return
  210.  
  211. ;********************* sub BuyRegs - This subroutine pathfinds to a vendor and buys chosen items.
  212. sub BuyRegs
  213. if #findCnt > 0 && %AtCove = #false
  214. {
  215. If #FindDist > 3 2
  216. set %pathfind #True
  217. event PathFind #findX #findY #findZ
  218. if %OpenDoor = #true ;This only happens at the Occlo mages.
  219. {
  220. set %VendorX #findX
  221. set %VendorY #findY
  222. set %VendorZ #findZ
  223. set %VendorID #findID
  224. findItem QULRJMD G_10
  225. event PathFind #findX #findY #findZ
  226. wait 3s
  227. set #lObjectID #FindID
  228. Event Macro 17
  229. ;click 334 222 d
  230. wait 2s
  231. event PathFind %VendorX %VendorY %VendorZ
  232. wait 3s
  233. set #LOBJECTID %VendorID
  234. }
  235. else ;This is where most vendors are dealt with. The others are exceptional cases.
  236. {
  237. set %PathFindCounter 0
  238. PATHFINDWAITLOOP:
  239. wait 1s
  240. set %PathFindCounter %PathFindCounter + 1
  241. if %PathFindCounter < %PathFindWait && ( #CHARPOSX <> #findX || #CHARPOSY <> #findY ) && %pathfind = #True
  242. {
  243. goto PATHFINDWAITLOOP
  244. }
  245. set #LOBJECTID #findID
  246. set %pathfind #False
  247. }
  248. }
  249. else
  250. {
  251. if %SecondMage = #false
  252. {
  253. set #LOBJECTID #findID
  254. }
  255. else
  256. {
  257. event PathFind #findX #findY #findZ
  258. wait 3s
  259. set %SecondMage #false
  260. }
  261. }
  262. event Macro 17 0
  263. set %NextGump %INITBUYGUMP
  264. gosub WaitForGump
  265. click 75 140
  266. set %NextGump %BILLGUMP
  267. gosub WaitForGump
  268.  
  269. BUYLOOP:
  270. click 200 20
  271. getShopInfo
  272. if #SHOPITEMNAME in %CompareString
  273. {
  274. click 249 87 d
  275. click 249 87 d
  276. set %counter %counter + 1
  277. ;wait 5
  278. setShopItem #SHOPITEMID #SHOPITEMMAX
  279. }
  280. if #SHOPCURPOS = #SHOPCNT || %counter = %_counter
  281. {
  282. click 364 426
  283. set %counter 0
  284. return
  285. }
  286. else
  287. {
  288. click 391 204
  289. ;wait 5
  290. goto BUYLOOP
  291. }
  292. return
  293.  
  294. ;********************* sub CheckWeight - This subroutine monitors weight. If you are overweight,
  295. ;********************* it will go home to unload and continue buying.
  296. sub CheckWeight
  297. if #WEIGHT > 380
  298. {
  299. event SysMessage You are overweight!
  300. gosub StoreRegs
  301. wait 2s
  302. set %OverWeightDrop #true
  303. }
  304. if #GOLD < 30000
  305. {
  306. event SysMessage You are poor as fuck!
  307. gosub StoreRegs
  308. wait 2s
  309. set %OverWeightDrop #true
  310. }
  311. return
  312.  
  313. ;********************* sub WaitForGump - This subroutine pauses execution of the script
  314. ;********************* until a specified gump appears.
  315. sub WaitForGump
  316. set %GumpTimer 0
  317. GUMPWAITLOOP:
  318. if #CONTKIND <> %NextGump && %GumpTimer < %GUMPTIMEOUT
  319. {
  320. set %GumpTimer %GumpTimer + 1
  321. wait 1s
  322. goto GUMPWAITLOOP
  323. }
  324. return
  325.  
  326. ;********************* sub RecallWait - This subroutine pauses execution of the script
  327. ;********************* until a character has recalled to a different location.
  328. sub RecallWait
  329. set %RecallTimer 0
  330. set %PreRecallX #CHARPOSX
  331. set %PreRecallY #CHARPOSY
  332. RECALLWAITLOOP:
  333. if #CHARPOSX = %PreRecallX && #CHARPOSY = %PreRecallY && %RecallTimer < %RECALLTIMEOUT
  334. {
  335. set %RecallTimer %RecallTimer + 1
  336. wait 1s
  337. goto RECALLWAITLOOP
  338. }
  339. return
  340.  
  341. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  342. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  343. ;@@@@@@@@@@@@@@@@@@@@@@@ THESE SUBROUTINES ARE RELATIVELY STATIC @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  344. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  345. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  346.  
  347.  
  348.  
  349. ;******************** sub MenuResults - This subroutine handles the results of the inital menu.
  350. ;******************** It builds a string to compare item names with in the buy
  351. ;******************** menu. It stores this in %CompareString
  352. sub MenuResults
  353. set %_counter 0
  354. menu Get chkBlackPearl
  355. if #menures = #true
  356. {
  357. set %StringAddition black_pearl_
  358. str Len %CompareString
  359. set %strLen #strRes + 1
  360. str Ins %CompareString %StringAddition %strLen
  361. set %CompareString #strRes
  362. set %_counter %_counter + 1
  363. }
  364. menu Get chkBloodMoss
  365. if #menures = #true
  366. {
  367. set %StringAddition blood_moss_
  368. str Len %CompareString
  369. set %strLen #strRes + 1
  370. str Ins %CompareString %StringAddition %strLen
  371. set %CompareString #strRes
  372. set %_counter %_counter + 1
  373. }
  374. menu Get chkGarlic
  375. if #menures = #true
  376. {
  377. set %StringAddition garlic_
  378. str Len %CompareString
  379. set %strLen #strRes + 1
  380. str Ins %CompareString %StringAddition %strLen
  381. set %CompareString #strRes
  382. set %_counter %_counter + 1
  383. }
  384. menu Get chkGinseng
  385. if #menures = #true
  386. {
  387. set %StringAddition ginseng_
  388. str Len %CompareString
  389. set %strLen #strRes + 1
  390. str Ins %CompareString %StringAddition %strLen
  391. set %CompareString #strRes
  392. set %_counter %_counter + 1
  393. }
  394. menu Get chkMandrakeRoot
  395. if #menures = #true
  396. {
  397. set %StringAddition mandrake_root_
  398. str Len %CompareString
  399. set %strLen #strRes + 1
  400. str Ins %CompareString %StringAddition %strLen
  401. set %CompareString #strRes
  402. set %_counter %_counter + 1
  403. }
  404. menu Get chkNightshade
  405. if #menures = #true
  406. {
  407. set %StringAddition nightshade_
  408. str Len %CompareString
  409. set %strLen #strRes + 1
  410. str Ins %CompareString %StringAddition %strLen
  411. set %CompareString #strRes
  412. set %_counter %_counter + 1
  413. }
  414. menu Get chkSpiderSilk
  415. if #menures = #true
  416. {
  417. set %StringAddition spider's_silk_
  418. str Len %CompareString
  419. set %strLen #strRes + 1
  420. str Ins %CompareString %StringAddition %strLen
  421. set %CompareString #strRes
  422. set %_counter %_counter + 1
  423. }
  424. menu Get chkSulphurousAsh
  425. if #menures = #true
  426. {
  427. set %StringAddition sulphurous_ash_
  428. str Len %CompareString
  429. set %strLen #strRes + 1
  430. str Ins %CompareString %StringAddition %strLen
  431. set %CompareString #strRes
  432. set %_counter %_counter + 1
  433. }
  434. menu Get chkEmptyBottles
  435. if #menures = #true
  436. {
  437. set %StringAddition empty_bottle_
  438. str Len %CompareString
  439. set %strLen #strRes + 1
  440. str Ins %CompareString %StringAddition %strLen
  441. set %CompareString #strRes
  442. set %_counter %_counter + 1
  443. }
  444. menu Get chkLesserPoisons
  445. if #menures = #true
  446. {
  447. set %StringAddition lesser_poison_potion_
  448. str Len %CompareString
  449. set %strLen #strRes + 1
  450. str Ins %CompareString %StringAddition %strLen
  451. set %CompareString #strRes
  452. set %_counter %_counter + 1
  453. }
  454. menu Hide
  455. return
  456.  
  457. ;******************** sub StoreRegs - This subroutine recalls home and transfers all regs from
  458. ;******************** your pouch to permanent storage. The id of the permanent
  459. ;******************** storage container is saved in %ReagentStorage
  460. sub StoreRegs
  461. if %PlaySound && %PageNumber = 9 && %BuyCount = 16
  462. execute %sound
  463. event Macro 15 30
  464. target 6s
  465. set #LTARGETID %HomeRune
  466. event Macro 22 0
  467. wait 2s
  468. ;Open our pouch
  469. set #LOBJECTID %RegPouch
  470. event Macro 17 0
  471. wait 2s
  472. contPos 400 400
  473. set %temp C_
  474. str Ins %temp %RegPouch 3
  475. findItem RZF #strRes ;spider's silk
  476. if #findCnt > 0
  477. {
  478. set %StackSize #findStack - 50
  479. exevent Drag #findID %StackSize
  480. exevent Dropc %ReagentStorage
  481. }
  482. findItem KUF #strRes ;black pearl
  483. if #findCnt > 0
  484. {
  485. set %StackSize #findStack - 50
  486. exevent Drag #findID %StackSize
  487. exevent Dropc %ReagentStorage
  488. }
  489. findItem JZF #strRes ;ginseng
  490. if #findCnt > 0
  491. {
  492. set %StackSize #findStack - 50
  493. exevent Drag #findID %StackSize
  494. exevent Dropc %ReagentStorage
  495. }
  496. findItem JUF #strRes ;blood moss
  497. if #findCnt > 0
  498. {
  499. set %StackSize #findStack - 50
  500. exevent Drag #findID %StackSize
  501. exevent Dropc %ReagentStorage
  502. }
  503. findItem SZF #strRes ;sulphurous ash
  504. if #findCnt > 0
  505. {
  506. set %StackSize #findStack - 50
  507. exevent Drag #findID %StackSize
  508. exevent Dropc %ReagentStorage
  509. }
  510. findItem KZF #strRes ;garlic
  511. if #findCnt > 0
  512. {
  513. set %StackSize #findStack - 50
  514. exevent Drag #findID %StackSize
  515. exevent Dropc %ReagentStorage
  516. }
  517.  
  518. findItem MZF #strRes ;mandrake root
  519. if #findCnt > 0
  520. {
  521. set %StackSize #findStack - 50
  522. exevent Drag #findID %StackSize
  523. exevent Dropc %ReagentStorage
  524. }
  525. findItem WZF #strRes ;nightshade
  526. if #findCnt > 0
  527. {
  528. set %StackSize #findStack - 50
  529. exevent Drag #findID %StackSize
  530. exevent Dropc %ReagentStorage
  531. }
  532. ;Last we need to search for bottles or lesser poisons in the main backpack
  533. set %temp C_
  534. str Ins %temp #BACKPACKID 3
  535. findItem WUF #strRes ;empty bottles
  536. if #findCnt > 0
  537. {
  538. exevent Drag #findID #findStack
  539. exevent Dropc %ReagentStorage
  540. }
  541. findItem AVF #strRes ;lesser poisons
  542. if #findCnt > 0
  543. {
  544. exevent Drag #findID #findStack
  545. exevent Dropc %ReagentStorage
  546. }
  547. set %DropOff #true
  548. wait 5
  549. if #GOLD < 60000
  550. {
  551. finditem %ReagentStorage G_2
  552. wait 5
  553. if #findkind <> -1
  554. {
  555. set #lobjectid #findid
  556. event macro 17
  557. wait 15
  558. }
  559. finditem POF C_ , %ReagentStorage
  560. wait 5
  561. Exevent drag #findid 60000
  562. wait 5
  563. Exevent dropc #backpackid
  564. }
  565. return
  566.  
  567. ;******************** sub MoveRegs - This subroutine transfers all regs from your backpack to
  568. ;******************** your pouch after buying from all vendors at a location.
  569. sub MoveRegs
  570. set %temp C_
  571. str Ins %temp #BACKPACKID 3
  572. set %MyBackpack #strRes
  573. findItem RZF %MyBackpack ;spider's silk
  574. if #findCnt > 0
  575. {
  576. exevent Drag #findID #findStack
  577. exevent Dropc %RegPouch
  578. }
  579. findItem KUF %MyBackpack ;black pearl
  580. if #findCnt > 0
  581. {
  582. exevent Drag #findID #findStack
  583. exevent Dropc %RegPouch
  584. }
  585. findItem JZF %MyBackpack ;ginseng
  586. if #findCnt > 0
  587. {
  588. exevent Drag #findID #findStack
  589. exevent Dropc %RegPouch
  590. }
  591. findItem JUF %MyBackpack ;blood moss
  592. if #findCnt > 0
  593. {
  594. exevent Drag #findID #findStack
  595. exevent Dropc %RegPouch
  596. }
  597. findItem SZF %MyBackpack ;sulphurous ash
  598. if #findCnt > 0
  599. {
  600. exevent Drag #findID #findStack
  601. exevent Dropc %RegPouch
  602. }
  603. findItem KZF %MyBackpack ;garlic
  604. if #findCnt > 0
  605. {
  606. exevent Drag #findID #findStack
  607. exevent Dropc %RegPouch
  608. }
  609. findItem MZF %MyBackpack ;mandrake root
  610. if #findCnt > 0
  611. {
  612. exevent Drag #findID #findStack
  613. exevent Dropc %RegPouch
  614. }
  615.  
  616. findItem WZF %MyBackpack ;nightshade
  617. if #findCnt > 0
  618. {
  619. exevent Drag #findID #findStack
  620. exevent Dropc %RegPouch
  621. }
  622. return
  623.  
  624. ;******************** sub Buy_____ - This block contains subroutines for buying regs from vendors
  625. ;******************** at a specific location. Any location specific modifications
  626. ;******************** should be placed here. Any new vendor location must have a
  627. ;******************** correspnding subroutine here.
  628. sub BuyYewRegs
  629. ;Buy from Vendors
  630. set %PathFindWait 4
  631. findItem LED G_20 ;Marcin the mage
  632. if #FindKind <> -1
  633. gosub BuyRegs
  634. findItem MED G_20 ;Kuba the mage
  635. if #FindKind <> -1
  636. gosub BuyRegs
  637. findItem RED G_20 ;Konrad the mage
  638. if #FindKind <> -1
  639. gosub BuyRegs
  640. findItem OED G_20 ;Iria the alchemist
  641. if #FindKind <> -1
  642. gosub BuyRegs
  643. wait 2s
  644. ;Put regs in a pouch
  645. gosub MoveRegs
  646. return
  647.  
  648. sub BuyMerlinRegs
  649. set %PathFindWait 5
  650. ;Buy from vendors.
  651. findItem OXX G_20 ;Adrian, Merlin's Disciple
  652. if #FindKind <> -1
  653. gosub BuyRegs
  654. findItem OXMBB G_20 ;Merlin the High Wizard
  655. if #FindKind <> -1
  656. gosub BuyRegs
  657. set %PathFindWait 10
  658. event pathFind 3760 2105 20
  659. findItem ZZX G_30 ;A Merlin's Disciple
  660. if #FindKind <> -1
  661. gosub BuyRegs
  662. findItem FAY G_30 ;A Merlin's Disciple
  663. if #FindKind <> -1
  664. gosub BuyRegs
  665. wait 2s
  666. gosub MoveRegs
  667. return
  668.  
  669. sub BuyMaginciaWestRegs
  670. set %PathFindWait 4
  671. findItem ROHC G_20 ;Geo the Mage
  672. if #FindKind <> -1
  673. gosub BuyRegs
  674. findItem SOHC G_20 ;Benny the Mage
  675. if #FindKind <> -1
  676. gosub BuyRegs
  677. findItem LIGD G_20 ;Jeanett the Alchemist
  678. if #FindKind <> -1
  679. gosub BuyRegs
  680. wait 2s
  681. gosub MoveRegs
  682. return
  683.  
  684. sub BuyMaginciaEastRegs
  685. set %PathFindWait 5
  686. findItem AQI G_20 ;Raymond the Mage
  687. if #FindKind <> -1
  688. gosub BuyRegs
  689. findItem ZPI G_20 ;Vlad the Mage
  690. if #FindKind <> -1
  691. gosub BuyRegs
  692. findItem CQI G_20 ;Gord the Mage
  693. if #FindKind <> -1
  694. gosub BuyRegs
  695. wait 2s
  696. gosub MoveRegs
  697. return
  698.  
  699. sub BuyBritWestRegs
  700. set %PathFindWait 4
  701. findItem NYC G_20 ;Nicholas the mage
  702. if #FindKind <> -1
  703. gosub BuyRegs
  704. findItem OYC G_20 ;Kent the mage
  705. if #FindKind <> -1
  706. gosub BuyRegs
  707. wait 2s
  708. gosub MoveRegs
  709. return
  710.  
  711. sub BuyBritEastRegs
  712. set %PathFindWait 3
  713. findItem ZEDC ;Lumpour the Alchemist
  714. if #FindKind <> -1
  715. gosub BuyRegs
  716. findItem OEDC ;Lisa the mage
  717. if #FindKind <> -1
  718. gosub BuyRegs
  719. findItem SGPF ;Danica the mage
  720. if #FindKind <> -1
  721. gosub BuyRegs
  722. wait 2s
  723. gosub MoveRegs
  724. return
  725.  
  726. sub BuyBritSouthRegs
  727. set %PathFindWait 3
  728. findItem XXC ; Spock the al
  729. if #FindKind <> -1
  730. gosub BuyRegs
  731. findItem YXC ; Kirk the herbalist
  732. if #FindKind <> -1
  733. gosub BuyRegs
  734. wait 2s
  735. gosub MoveRegs
  736. return
  737.  
  738. sub BuyTrinsicSouthRegs
  739. set %PathFindWait 3
  740. findItem BHD ;Twardy the mage
  741. if #FindKind <> -1
  742. gosub BuyRegs
  743. findItem CHD ;Lizawka the alch
  744. if #FindKind <> -1
  745. gosub BuyRegs
  746. wait 2s
  747. gosub MoveRegs
  748. return
  749.  
  750. sub BuyTrinsicNorthRegs
  751. set %PathFindWait 3
  752. findItem SGD ; Chmielu the mage
  753. if #FindKind <> -1
  754. gosub BuyRegs
  755. findItem RGD ;Marty the mage
  756. if #FindKind <> -1
  757. gosub BuyRegs
  758. findItem QGD ;Blazej the alchemist
  759. if #FindKind <> -1
  760. gosub BuyRegs
  761. findItem PGD ; Dorota the mage
  762. if #FindKind <> -1
  763. gosub BuyRegs
  764. wait 2s
  765. gosub MoveRegs
  766. return
  767.  
  768. sub BuyCoveRegs
  769. set %PathFindWait 4
  770. set %AtCove #true
  771. findItem NDD ;Anne the mage
  772. if #FindKind <> -1
  773. gosub BuyRegs
  774. set %SecondMage #true
  775. findItem ODD ;Ned the herbalist
  776. if #FindKind <> -1
  777. gosub BuyRegs
  778. wait 2s
  779. gosub MoveRegs
  780. set %AtCove #false
  781. set %SecondMage #false
  782. return
  783.  
  784. sub BuyJhelomSouthRegs
  785. set %PathFindWait 3
  786. findItem DBG G_20 ;Damien the Mage
  787. if #FindKind <> -1
  788. gosub BuyRegs
  789. wait 2s
  790. gosub MoveRegs
  791. return
  792.  
  793. sub BuyJhelomNorthRegs
  794. set %PathFindWait 3
  795. findItem YAG G_20 ;Abra the Mage
  796. if #FindKind <> -1
  797. gosub BuyRegs
  798. wait 2s
  799. gosub MoveRegs
  800. return
  801.  
  802. sub BuyJhelomDocksRegs
  803. set %PathFindWait 2
  804. findItem BAYWD G_20 ;Hogwart the Witch
  805. if #FindKind <> -1
  806. gosub BuyRegs
  807. findItem CAYWD G_20 ;Mildred the Witch
  808. if #FindKind <> -1
  809. gosub BuyRegs
  810. findItem WZXWD G_20 ;Drathmore the Mage
  811. if #FindKind <> -1
  812. gosub BuyRegs
  813. wait 2s
  814. gosub MoveRegs
  815. return
  816.  
  817. sub BuySouthJhelomIslandRegs
  818. set %PathFindWait 3
  819. findItem PAG G_20 ;Melissa the Mage
  820. if #FindKind <> -1
  821. gosub BuyRegs
  822. findItem SAG G_20 ;Eli the Mage
  823. if #FindKind <> -1
  824. gosub BuyRegs
  825. wait 2s
  826. gosub MoveRegs
  827. return
  828.  
  829. sub BuyMoonglowNorthRegs
  830. set %PathFindWait 5
  831. findItem PMD ;Claire the mage
  832. if #FindKind <> -1
  833. gosub BuyRegs
  834. findItem SMD ;Chris the mage
  835. if #FindKind <> -1
  836. gosub BuyRegs
  837. findItem RMD ;pencer the mage
  838. if #FindKind <> -1
  839. gosub BuyRegs
  840. wait 2s
  841. gosub MoveRegs
  842. return
  843.  
  844. sub BuyMoonglowSouthRegs
  845. set %PathFindWait 3
  846. findItem NMD ;Zolta the alchemist
  847. if #FindKind <> -1
  848. gosub BuyRegs
  849. wait 2s
  850. gosub MoveRegs
  851. return
  852.  
  853. sub BuyMoonglowSouthAlchemistRegs
  854. set %PathFindWait 3
  855. findItem AXF G_20 ;Todd the Alchemist
  856. if #FindKind <> -1
  857. gosub BuyRegs
  858. wait 2s
  859. gosub MoveRegs
  860. return
  861.  
  862. sub BuyOccloRegs
  863. set %PathFindWait 5
  864. findItem CYF G_20 ;Tommie the Mage
  865. if #FindKind <> -1
  866. gosub BuyRegs
  867. findItem BYF G_20 ;Jeff the Alchemist
  868. if #FindKind <> -1
  869. gosub BuyRegs
  870. findItem ZSFC G_20 ;Frida the Mage
  871. if #FindKind <> -1
  872. set %OpenDoor #true
  873. gosub BuyRegs
  874. wait 2s
  875. gosub MoveRegs
  876. set %OpenDoor #false
  877. return
  878.  
  879. sub BuySkaraBraeRegs
  880. set %PathFindWait 4
  881. findItem OND ;Bob the mage
  882. if #FindKind <> -1
  883. gosub BuyRegs
  884. wait 2s
  885. gosub MoveRegs
  886. return
  887.  
  888. sub BuySkaraBraeNorthRegs
  889. set %PathFindWait 3
  890. findItem GID ;Siwa the alchemist
  891. if #FindKind <> -1
  892. gosub BuyRegs
  893. wait 2s
  894. gosub MoveRegs
  895. return
  896.  
  897. sub BuyVesperSouthRegs
  898. set %PathFindWait 5
  899. findItem KBD ;Amen the mage
  900. if #FindKind <> -1
  901. gosub BuyRegs
  902. findItem JBD ;Lucy the mage
  903. if #FindKind <> -1
  904. gosub BuyRegs
  905. wait 2s
  906. gosub MoveRegs
  907. return
  908.  
  909. sub BuyVesperNorthRegs
  910. set %PathFindWait 4
  911. findItem QBD ;Ben the mage
  912. if #FindKind <> -1
  913. gosub BuyRegs
  914. findItem PBD ;Troy the alchemist
  915. if #FindKind <> -1
  916. gosub BuyRegs
  917. wait 2s
  918. gosub MoveRegs
  919. return
  920.  
  921. sub BuyVesperSoutheastRegs
  922. set %PathFindWait 3
  923. findItem VBD ;Bayu the lachemist
  924. if #FindKind <> -1
  925. gosub BuyRegs
  926. wait 2s
  927. gosub MoveRegs
  928. return
  929.  
  930. sub BuyMinocAlchemistRegs
  931. set %PathFindWait 2
  932. findItem WBJ G_20 ;Sonya the Alchemist
  933. if #FindKind <> -1
  934. gosub BuyRegs
  935. wait 2s
  936. gosub MoveRegs
  937. return
  938.  
  939. sub BuyMinocGypsyMageRegs
  940. set %PathFindWait 3
  941. findItem KYDC ;Battousai the alchemist
  942. if #FindKind <> -1
  943. gosub BuyRegs
  944. findItem JYDC ;Decius the mage
  945. if #FindKind <> -1
  946. gosub BuyRegs
  947. wait 2s
  948. gosub MoveRegs
  949. return
  950.  
  951. sub BuyNuJelmMageRegs
  952. set %PathFindWait 5
  953. findItem ZTG G_20 ;Fredrica the Mage
  954. if #FindKind <> -1
  955. gosub BuyRegs
  956. findItem AUG G_20 ;Otto the Mage
  957. if #FindKind <> -1
  958. gosub BuyRegs
  959. findItem CUG G_20 ;Avian the Mage
  960. if #FindKind <> -1
  961. gosub BuyRegs
  962. wait 2s
  963. gosub MoveRegs
  964. return
  965.  
  966. sub BuyNuJelmAlchemistRegs
  967. set %PathFindWait 5
  968. findItem OUIHB G_20 ;Alchemist 1
  969. if #FindKind <> -1
  970. gosub BuyRegs
  971. findItem IUIHB G_20 ;Alchemist 2
  972. if #FindKind <> -1
  973. gosub BuyRegs
  974. findItem LUIHB G_20 ;Alchemist 3
  975. if #FindKind <> -1
  976. gosub BuyRegs
  977. findItem NUIHB G_20 ;Alchemist 3
  978. if #FindKind <> -1
  979. gosub BuyRegs
  980. wait 2s
  981. gosub MoveRegs
  982. return
  983.  
  984. sub BuyMinocRegs
  985. set %PathFindWait 5
  986. findItem ABD ;Nelson the mage
  987. if #FindKind <> -1
  988. gosub BuyRegs
  989. findItem TAD ;Ophelia the alchemist
  990. if #FindKind <> -1
  991. gosub BuyRegs
  992. findItem ZAD ;Thomas the mage
  993. if #FindKind <> -1
  994. gosub BuyRegs
  995. findItem UAD ;Nancy the herbalist
  996. if #FindKind <> -1
  997. gosub BuyRegs
  998. wait 2s
  999. gosub MoveRegs
  1000. return
  1001.  
  1002. ;******************** sub DetermineVendor - This subroutine uses the #CHARPOSX, #CHARPOSY to determine
  1003. ;******************** which vendor location you are at. If any new vendors are
  1004. ;******************** are added, their location boundaries must be added here.
  1005. sub DetermineVendor
  1006. if #CHARPOSX <= 3720 && #CHARPOSX >= 3678 && #CHARPOSY <= 2231 && #CHARPOSY >= 2190
  1007. {
  1008. event SysMessage You are in Magincia West!
  1009. gosub BuyMaginciaWestRegs
  1010. set %VendorFound #true
  1011. }
  1012. if #CHARPOSX <= 3784 && #CHARPOSX >= 3747 && #CHARPOSY <= 2129 && #CHARPOSY >= 2093
  1013. {
  1014. event SysMessage You are in Merlin's!
  1015. gosub BuyMerlinRegs
  1016. set %VendorFound #true
  1017. }
  1018. if #CHARPOSX <= 630 && #CHARPOSX >= 624 && #CHARPOSY <= 846 && #CHARPOSY >= 832
  1019. {
  1020. event SysMessage You are in Yew!
  1021. gosub BuyYewRegs
  1022. set %VendorFound #true
  1023. }
  1024. if #CHARPOSX <= 3808 && #CHARPOSX >= 3777 && #CHARPOSY <= 2272 && #CHARPOSY >= 2233
  1025. {
  1026. event SysMessage You are in Magincia East!
  1027. gosub BuyMaginciaEastRegs
  1028. set %VendorFound #true
  1029. }
  1030. if #CHARPOSX <= 1498 && #CHARPOSX >= 1484 && #CHARPOSY <= 1558 && #CHARPOSY >= 1544
  1031. {
  1032. event SysMessage You are in Brit West!
  1033. gosub BuyBritWestRegs
  1034. set %VendorFound #true
  1035. }
  1036. if #CHARPOSX <= 1598 && #CHARPOSX >= 1584 && #CHARPOSY <= 1662 && #CHARPOSY >= 1648
  1037. {
  1038. event SysMessage You are in Brit East!
  1039. gosub BuyBritEastRegs
  1040. set %VendorFound #true
  1041. }
  1042. if #CHARPOSX <= 1506 && #CHARPOSX >= 1496 && #CHARPOSY <= 1666 && #CHARPOSY >= 1656
  1043. {
  1044. event SysMessage You are in Brit South!
  1045. gosub BuyBritSouthRegs
  1046. set %VendorFound #true
  1047. }
  1048. if #CHARPOSX <= 1850 && #CHARPOSX >= 1837 && #CHARPOSY <= 2708 && #CHARPOSY >= 2701
  1049. {
  1050. event SysMessage You are in Trinsic South!
  1051. gosub BuyTrinsicSouthRegs
  1052. set %VendorFound #true
  1053. }
  1054. if #CHARPOSX <= 1861 && #CHARPOSX >= 1844 && #CHARPOSY <= 2686 && #CHARPOSY >= 2673
  1055. {
  1056. event SysMessage You are in Trinsic North!
  1057. gosub BuyTrinsicNorthRegs
  1058. set %VendorFound #true
  1059. }
  1060. if #CHARPOSX <= 2286 && #CHARPOSX >= 2280 && #CHARPOSY <= 1230 && #CHARPOSY >= 1224
  1061. {
  1062. event SysMessage You are in Cove!
  1063. gosub BuyCoveRegs
  1064. set %VendorFound #true
  1065. }
  1066. if #CHARPOSX <= 1462 && #CHARPOSX >= 1456 && #CHARPOSY <= 3830 && #CHARPOSY >= 3816
  1067. {
  1068. event SysMessage You are in Jhelom South!
  1069. gosub BuyJhelomSouthRegs
  1070. set %VendorFound #true
  1071. }
  1072. if #CHARPOSX <= 1462 && #CHARPOSX >= 1456 && #CHARPOSY <= 3806 && #CHARPOSY >= 3792
  1073. {
  1074. event SysMessage You are in Jhelom North!
  1075. gosub BuyJhelomNorthRegs
  1076. set %VendorFound #true
  1077. }
  1078. if #CHARPOSX <= 1382 && #CHARPOSX >= 1376 && #CHARPOSY <= 3854 && #CHARPOSY >= 3848
  1079. {
  1080. event SysMessage You are in Jhelom Docks!
  1081. gosub BuyJhelomDocksRegs
  1082. set %VendorFound #true
  1083. }
  1084. if #CHARPOSX <= 1430 && #CHARPOSX >= 1419 && #CHARPOSY <= 3990 && #CHARPOSY >= 3976
  1085. {
  1086. event SysMessage You are in South Jhelom Island!
  1087. gosub BuySouthJhelomIslandRegs
  1088. set %VendorFound #true
  1089. }
  1090. if #CHARPOSX <= 4463 && #CHARPOSX >= 4447 && #CHARPOSY <= 1094 && #CHARPOSY >= 1080
  1091. {
  1092. event SysMessage You are in Moonglow North!
  1093. gosub BuyMoonglowNorthRegs
  1094. set %VendorFound #true
  1095. }
  1096. if #CHARPOSX <= 4422 && #CHARPOSX >= 4408 && #CHARPOSY <= 1115 && #CHARPOSY >= 1108
  1097. {
  1098. event SysMessage You are in Moonglow North Alchemist!
  1099. gosub BuyMoonglowSouthRegs
  1100. set %VendorFound #true
  1101. }
  1102. if #CHARPOSX <= 4422 && #CHARPOSX >= 4408 && #CHARPOSY <= 1142 && #CHARPOSY >= 1129
  1103. {
  1104. event SysMessage You are in Moonglow South Alchemist!
  1105. gosub BuyMoonglowSouthAlchemistRegs
  1106. set %VendorFound #true
  1107. }
  1108. if #CHARPOSX <= 3630 && #CHARPOSX >= 3624 && #CHARPOSY <= 2550 && #CHARPOSY >= 2536
  1109. {
  1110. event SysMessage You are in Occlo!
  1111. gosub BuyOccloRegs
  1112. set %VendorFound #true
  1113. }
  1114. if #CHARPOSX <= 611 && #CHARPOSX >= 600 && #CHARPOSY <= 2182 && #CHARPOSY >= 2176
  1115. {
  1116. event SysMessage You are in Skara Brae South!
  1117. gosub BuySkaraBraeRegs
  1118. set %VendorFound #true
  1119. }
  1120. if #CHARPOSX <= 670 && #CHARPOSX >= 656 && #CHARPOSY <= 2142 && #CHARPOSY >= 2136
  1121. {
  1122. event SysMessage You are in Skara Brae North!
  1123. gosub BuySkaraBraeNorthRegs
  1124. set %VendorFound #true
  1125. }
  1126. if #CHARPOSX <= 2926 && #CHARPOSX >= 2912 && #CHARPOSY <= 678 && #CHARPOSY >= 664
  1127. {
  1128. event SysMessage You are in Vesper South!
  1129. gosub BuyVesperSouthRegs
  1130. set %VendorFound #true
  1131. }
  1132. if #CHARPOSX <= 2892 && #CHARPOSX >= 2883 && #CHARPOSY <= 654 && #CHARPOSY >= 648
  1133. {
  1134. event SysMessage You are in Vesper North!
  1135. gosub BuyVesperNorthRegs
  1136. set %VendorFound #true
  1137. }
  1138. ;if #CHARPOSX <= 2998 && #CHARPOSX >= 2992 && #CHARPOSY <= 846 && #CHARPOSY >= 832
  1139. if #CHARPOSX <= 2910 && #CHARPOSX >= 2904 && #CHARPOSY <= 718 && #CHARPOSY >= 704
  1140. {
  1141. event SysMessage You are in Vesper Southeast!
  1142. gosub BuyVesperSoutheastRegs
  1143. set %VendorFound #true
  1144. }
  1145. if #CHARPOSX <= 2552 && #CHARPOSX >= 2546 && #CHARPOSY <= 659 && #CHARPOSY >= 650
  1146. {
  1147. event SysMessage You are in Minoc Alchemist!
  1148. ;gosub BuyMinocAlchemistRegs
  1149. gosub BuyMinocGypsyMageRegs
  1150. set %VendorFound #true
  1151. }
  1152. if #CHARPOSX <= 2520 && #CHARPOSX >= 2514 && #CHARPOSY <= 659 && #CHARPOSY >= 650
  1153. {
  1154. event SysMessage You are in Minoc Gypsy Mage!
  1155. gosub BuyMinocGypsyMageRegs
  1156. set %VendorFound #true
  1157. }
  1158. if #CHARPOSX <= 3782 && #CHARPOSX >= 3760 && #CHARPOSY <= 1206 && #CHARPOSY >= 1184
  1159. {
  1160. event SysMessage You are in Nu'Jelm Mage!
  1161. gosub BuyNuJelmMageRegs
  1162. set %VendorFound #true
  1163. }
  1164. if #CHARPOSX <= 3702 && #CHARPOSX >= 3688 && #CHARPOSY <= 1271 && #CHARPOSY >= 1256
  1165. {
  1166. event SysMessage You are in Nu'Jelm Alchemist!
  1167. gosub BuyNuJelmAlchemistRegs
  1168. set %VendorFound #true
  1169. }
  1170. if #CHARPOSX <= 2465 && #CHARPOSX >= 2443 && #CHARPOSY <= 497 && #CHARPOSY >= 475
  1171. {
  1172. event SysMessage You are in Minoc!
  1173. gosub BuyMinocRegs
  1174. set %VendorFound #true
  1175. }
  1176. if %VendorFound = #true
  1177. {
  1178. set %BuyCount %BuyCount + 1
  1179. if %BuyCount % 2 = 0
  1180. {
  1181. set %PageNumber %PageNumber + 1
  1182. }
  1183. }
  1184. else
  1185. {
  1186. event SysMessage Unknown vendor! Going to the next vendor!
  1187. set %BuyCount %BuyCount + 1
  1188. if %BuyCount % 2 = 0
  1189. {
  1190. set %PageNumber %PageNumber + 1
  1191. }
  1192. }
  1193. set %VendorFound #false
  1194. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement