Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.41 KB | None | 0 0
  1. ;==================================
  2. ; Script Name: Raziel's Bod Gathering Script
  3. ; Author: Raziel
  4. ; Version: 1.52
  5. ; Client Tested with: 4.0.9b
  6. ; EUO version tested with: EasyUO V1.42 [Build 00A3]
  7. ; Shard OSI / FS: OSI
  8. ; Revision Date: 27/08/2005
  9. ; Public Release: 10/08/2003
  10. ; Global Variables Used:
  11. ; Purpose: Auto Gathers bods ( multi chars/accounts/shards )
  12. ;==================================
  13. ;******************************************************************
  14. ; edit these options if you like, though defaults are fine.
  15. set %sortDesktop #false ; #true or #false, organises your desktop
  16. set %cancelRewards #false ; #true or #false, cancels AOS gift and vet reward gump
  17. set %clickMod DMC ; MC = move cursor, DMC = don't move cursor. MC will improve your bod gathering speed ( but will move your cursor when it clicks the npc )
  18. set %option 2 ;this is the option on the context menu you must click to get a bod "bod info" OSI is 2 but freeshards may vary, set this here.
  19. set %hoursBetweenBods 1 ;this is how many hours between each bod being availible. default is 6 hours.
  20. ;******************************************************************
  21. goto Begin ;do not delete this line
  22. ;*****************************************************************
  23. sub account1
  24. msg account1
  25. wait 10
  26. click 530 400
  27. msg account1
  28. wait 20
  29. msg $
  30. return
  31. ;******************************************************************
  32. sub account2
  33. msg account2
  34. wait 10
  35. click 530 400
  36. msg account2
  37. wait 20
  38. msg $
  39. return
  40. ;******************************************************************
  41. sub account3
  42. msg account3
  43. wait 10
  44. click 530 400
  45. msg account3
  46. wait 20
  47. msg $
  48. return
  49. ;******************************************************************
  50. sub account4
  51. msg account4
  52. wait 10
  53. click 530 400
  54. msg account4
  55. wait 20
  56. msg $
  57. return
  58. ;******************************************************************
  59. bodlines:
  60. ;******************************************************************
  61. ;******************************************************************
  62. ;gosub bod lines below this
  63. ;******************************************************************
  64. ;******************************************************************
  65. gosub bodcycle 1 4 recall 2
  66. ;******************************************************************
  67. ;******************************************************************
  68. ;Edit nothing below this line
  69. ;******************************************************************
  70. ;******************************************************************
  71. wait 100
  72. Begin:
  73. gosub timeOld
  74. gosub makeMenu
  75. gosub waitBOD
  76. gosub _waitSysVar clilogged = 0
  77. set *RazielBodTime #time
  78. set *RazielBodDate #date
  79. goto bodlines
  80. ;******************************************************************
  81. sub bodCycle
  82. namespace push
  83. namespace local bodCycle
  84. set !loginAttemps 0
  85. set !account %1
  86. set !char %2
  87. set !recallOrRail %3
  88. set !bodType %4
  89. set !shard %5
  90. set !numVars %0
  91.  
  92. ;Check for errors in bod cycle line
  93. set !accountCheck #false
  94. set !charCheck #false
  95. set !recallOrRailCheck #false
  96. set !bodTypeCheck #false
  97. set !shardCheck #false
  98. gosub checkNumber !account
  99. if ! #result
  100. set !accountCheck #true
  101. gosub checkNumber !char
  102. if ! #result || !char > 7
  103. set !charCheck #true
  104. if rail notin !recallOrRail && !recallOrRail recall_sacred
  105. set !recallOrRailCheck #true
  106. if _ , !bodType , _ notin _0_1_2_
  107. set !bodTypeCheck #true
  108. if !numVars > 4
  109. {
  110. gosub checkNumber !shard
  111. if #result
  112. set !shardCheck #true
  113. }
  114. gosub checkBodCycleLine !accountCheck !charCheck !recallOrRailCheck !bodTypeCheck !shardCheck !numVars
  115. if ! #result
  116. {
  117. namespace pop
  118. return
  119. }
  120. ;end error checking
  121.  
  122. _tryLoginAgain:
  123. if !numVars = 5
  124. gosub InfoMenu !account !char !recallOrRail !bodType !shard
  125. else
  126. gosub InfoMenu !account !char !recallOrRail !bodType
  127. if !numVars = 5
  128. gosub login !account !char !shard
  129. if !numVars = 4
  130. gosub login !account !char
  131. set !loginAttemps !loginAttemps + 1
  132. if ! #result
  133. {
  134. if !loginAttemps > 5
  135. {
  136. namespace pop
  137. return
  138. }
  139. gosub loginFailMenu
  140. if #result = skip
  141. {
  142. namespace pop
  143. return
  144. }
  145. if #result = tryAgain
  146. goto _tryLoginAgain
  147. }
  148. wait 40
  149. if %sortDesktop
  150. gosub SortDesktop
  151. if %cancelRewards
  152. gosub cancelRewards
  153. ignoreitem reset
  154. if !bodType = 0 || !bodType = 2
  155. {
  156. gosub moveTo tailor !bodType !recallOrRail
  157. if ! #result
  158. {
  159. gosub logout
  160. wait 300s
  161. namespace pop
  162. return
  163. }
  164. }
  165. if !bodType = 1 || !bodType = 2
  166. {
  167. gosub MoveTo smith !bodType !recallOrRail
  168. if ! #result
  169. {
  170. gosub logout
  171. wait 300s
  172. namespace pop
  173. return
  174. }
  175. }
  176. gosub moveTo inn !bodType !recallOrRail
  177. if ! #result
  178. {
  179. gosub logout
  180. wait 300s
  181. namespace pop
  182. return
  183. }
  184. finditem DYM C_ . #backpackid
  185. if #findkind = 0
  186. gosub bodbook
  187. wait 10
  188. gosub logout
  189. namespace pop
  190. return
  191. ;******************************************************************
  192. sub findNpc
  193. namespace push
  194. namespace local findNpc
  195. set !type %1
  196. set !previous %2
  197. set !arraySize 0
  198. set !element 1
  199. _findNpc:
  200. finditem IS_HS G_10
  201. ignoreitem #findid
  202. if #findkind <> -1
  203. {
  204. if #findrep = 7
  205. {
  206. event property #findid
  207. if !type = tailor
  208. {
  209. if guild notin #property
  210. {
  211. if weaver in #property || tailor in #property
  212. {
  213. set !npc . !element #findid
  214. set !arraySize !arraySize + 1
  215. set !element !element + 1
  216. }
  217. }
  218. }
  219. if !type = smith
  220. {
  221. if blacksmith in #property || armourer in #property
  222. {
  223. set !npc . !element #findid
  224. set !arraySize !arraySize + 1
  225. set !element !element + 1
  226. }
  227. }
  228. }
  229. goto _findNpc
  230. }
  231. ignoreitem reset
  232. set !npc none
  233. for !i 1 !arraySize
  234. {
  235. if !npc . !i <> !previous
  236. {
  237. set !npc !npc . !i
  238. set !i !arraySize
  239. }
  240. }
  241. if !npc = none
  242. set #result !previous
  243. else
  244. set #result !npc
  245. namespace pop
  246. return #result
  247. ;******************************************************************
  248. sub findRune
  249. ignoreitem reset
  250. if %0 = 2
  251. ignoreitem %2
  252. get_rune:
  253. finditem QWL C
  254. if #findkind = -1
  255. return -1
  256. event property #findid
  257. if #property = $
  258. goto get_rune
  259. if %1 in #property
  260. return #findid
  261. ignoreitem #findid
  262. goto get_rune
  263. ;******************************************************************
  264. sub login
  265. namespace push
  266. namespace local login
  267. set !loginMax 3 ;max number of times to look throught shardlist
  268. set %charCreate #false;for use later to determine if char creation came up
  269. ;key combo to restore/maximize
  270. set !key1 space
  271. set !key2 alt
  272. set !key3 x
  273. ;info on what char to login
  274. set !login0_ %0
  275. set !account %1
  276. set !char %2
  277. set !shard %3
  278. ;conditional inclusion of shard scanner
  279. if ! !shardScannerInit && !login0_ = 3
  280. {
  281. call shardScanner.txt init
  282. set !shardScannerInit #true
  283. }
  284. login:
  285. ;wait for char to be logged out and at main login
  286. gosub _waitSysVar clilogged = 0 contname = mainmenu_gump 60
  287. if ! #result
  288. {
  289. if #contsize = 356_212
  290. gosub backTrack login_gump mainMenu_gump
  291. goto login
  292. }
  293. set !shardloc 1 ;initialize
  294. ;clear old Account and pass
  295. set !y !char * 40 + 100
  296. click 530 360
  297. for !i 1 16
  298. {
  299. key back
  300. }
  301. wait 10
  302. click 530 400
  303. for !i 1 16
  304. {
  305. key back
  306. }
  307. wait 20
  308. click 530 360
  309. ;type account and pass
  310. gosub account . !account
  311. ;wait for shard select screen
  312. _waitShard:
  313. gosub _waitSysVar contname = normal_gump 60
  314. if ! #result
  315. {
  316. ;wait shard select timed out, determine what to do next
  317. gosub determineAction normal_gump
  318. goto #result
  319. }
  320. set %shardContKind #contkind;for use later to determine if char creation came up
  321. ;shard selection
  322. if !login0_ = 3
  323. {
  324. ;use key combo to restore/maximize uo
  325. ;shard scanner must be able to "see" uo
  326. key !key1 !key2
  327. wait 40
  328. key !key3
  329. wait 20
  330. click 640 480 mc ;move cursor out of the way so it doesn't mess up shardscanner
  331. ;check choosen shard is selected
  332. call shardScanner.txt isShardNameSupported !shard
  333. if #result = #false
  334. {
  335. ;shard not supported
  336. display ok Either your choosen shard is not supported or you have mis-spelt the shard name. Please check and try again. Shard name ( %shard )
  337. halt
  338. }
  339. set !recheck 0;initialize
  340. set !listCheck 0;number of times the list has been checked
  341. _shardList:
  342. if !recheck > 4 ;4 = number of pages of shards
  343. {
  344. set !listCheck !listCheck + 1
  345. if !listCheck > !loginMax ;reached max login attemps
  346. {
  347. gosub determineAction loginMax
  348. namespace pop
  349. return #false
  350. }
  351. ;reached the bottom of the shard list
  352. click 540 100 x 40 ;goto top
  353. set !recheck 0
  354. }
  355. set !login_i -1
  356. _shardloop: ;check all 9 shards visible on the list
  357. set !login_i !login_i + 1
  358. call shardScanner.txt checkLineForShard !login_i !shard
  359. if ! #result && !login_i <= 8 ;shard is not target, but there are other shards visible to check, try next
  360. goto _shardloop
  361. if ! #result ;shard is not target shard, go down a page
  362. {
  363. set !recheck !recheck + 1
  364. wait 10
  365. click 535 350 x 9
  366. wait 20
  367. goto _shardList
  368. }
  369. ;shard found
  370. set !clicky 25 * !login_i + 110
  371. click 300 !clicky g
  372. }
  373. if !login0_ < 3 ;if no shard specified
  374. msg $ ; just login to last shard
  375. _waitCharSelect:
  376. gosub _waitSysVar contname = normal_gump 20
  377. if ! #result
  378. {
  379. if %charCreate
  380. {
  381. gosub backTrack unknown mainMenu_gump
  382. namespace pop
  383. return #false
  384. }
  385. gosub determineAction normal_gump
  386. goto #result
  387. }
  388. wait 15
  389. click 300 !y d
  390. _login3:
  391. gosub _waitSysVar contname = normal_gump 2
  392. if #result
  393. {
  394. click 612 452
  395. wait 5
  396. click 612 452
  397. wait 5
  398.  
  399. click 612 452
  400.  
  401. wait 5
  402. goto _login3
  403. }
  404. _waitlogin:
  405. gosub _waitSysVar clilogged = 1 5
  406. if ! #result
  407. {
  408. gosub determineAction login
  409. goto #result
  410. }
  411. wait 80
  412. if #charname = N/A
  413. {
  414. event macro 8 2
  415. gosub _waitSysVar contname = status_gump 10
  416. if ! #result
  417. goto _waitlogin
  418. }
  419. namespace pop
  420. return #true
  421. ;******************************************************************
  422. sub _waitSysVar
  423. namespace push
  424. namespace local _waitForSysVar
  425. set !timeout #scnt + % . %0
  426. set !cnt %0 / 3
  427. set !break #false
  428. for !i 1 !cnt
  429. {
  430. set !x !i * 3 - 2
  431. set !y !x + 1
  432. set !z !y + 1
  433. if ! ( # . % . !x % . !y % . !z )
  434. set !i 0
  435. if %0 % 3 = 1 && #scnt > !timeout
  436. {
  437. namespace pop
  438. return #false
  439. }
  440. }
  441. namespace pop
  442. return #true
  443. ;***************************************************************************************************
  444. sub determineAction
  445. namespace push
  446. namespace local determineAction
  447. set !problem %1
  448. _Action:
  449. if !problem = normal_gump
  450. {
  451. if #contname = normal_gump
  452. {
  453. namespace pop
  454. return _waitShard
  455. }
  456. if #contname = waiting_gump
  457. {
  458. gosub backTrack normal_gump mainMenu_gump
  459. if #result
  460. {
  461. namespace pop
  462. return login
  463. }
  464. if ! #result
  465. goto _Action
  466. }
  467. }
  468. if !problem = loginMax
  469. {
  470. gosub backTrack login_gump mainMenu_gump
  471. if #result
  472. {
  473. namespace pop
  474. return
  475. }
  476. }
  477. if !problem = login_gump
  478. {
  479. if #contname = login_gump
  480. {
  481. namespace pop
  482. return _waitCharSelect
  483. }
  484. if #contname = normal_gump && #contkind <> %shardContKind && ! %charCreate
  485. {
  486. set %charCreate #true
  487. gosub backTrack unknown mainMenu_gump
  488. if #result
  489. {
  490. namespace pop
  491. return login
  492. }
  493. }
  494. gosub backTrack login_gump normal_gump
  495. if #result
  496. {
  497. namespace pop
  498. return _waitShard
  499. }
  500. gosub backTrack login_gump mainMenu_gump
  501. if #result
  502. {
  503. namespace pop
  504. return login
  505. }
  506. }
  507. if !problem = login
  508. {
  509. if #clilogged = 1
  510. {
  511. namespace pop
  512. return _waitlogin
  513. }
  514. gosub backTrack unknown login_gump
  515. if #result
  516. {
  517. namespace pop
  518. return _waitCharSelect
  519. }
  520. if #contname = normal_gump
  521. {
  522. namespace pop
  523. return _waitShard
  524. }
  525. if #contname = mainMenu_gump
  526. {
  527. namespace pop
  528. return login
  529. }
  530. gosub backTrack unknown mainMenu_gump
  531. goto _Action
  532. }
  533. display ok Unknown Problem. Halting!
  534. halt
  535. ;******************************************************************
  536. sub backTrack
  537. namespace push
  538. namespace local backTrack
  539. set !currentScreen %1
  540. set !targetScreen %2
  541. gosub convertScreen !currentScreen
  542. set !currentScreen #result
  543. gosub convertScreen !targetScreen
  544. set !targetScreen #result
  545. ;3 = mainmenu_gump
  546. ;2 = normal_gump
  547. ;1 = login_gump
  548. ;0 = unknown
  549. _backTrack:
  550. if #contname in mainmenu_gump_normal_gump_login_gump
  551. {
  552. gosub convertScreen #contname
  553. set !currentScreen #result
  554. }
  555. if !targetScreen < !currentScreen
  556. {
  557. namespace pop
  558. return #false
  559. }
  560. if !currentScreen = !targetScreen
  561. {
  562. namespace pop
  563. return #true
  564. }
  565. if #contname = waiting_gump
  566. {
  567. str pos #contsize _
  568. set !temp #strres - 1
  569. str left #contsize !temp
  570. set !x ( #strres / 2 ) + #contposX
  571. str pos #contsize _
  572. str del #contsize 1 #strres
  573. set !y #strres + #contposY - 34
  574. click !x !y
  575. gosub _waitSysVar contname <> waiting_gump 2
  576. goto _backTrack
  577. }
  578. goto _backTrack . !currentScreen
  579. _backTrack1:
  580. click 600 450
  581. gosub _waitSysVar contname = nomal_gump 5
  582. goto _backTrack
  583. _backTrack2:
  584. click 600 450
  585. gosub _waitSysVar contname = mainmenu_gump 5
  586. goto _backTrack
  587. _backTrack3:
  588. goto _backTrack
  589.  
  590. ;******************************************************************
  591. sub convertScreen
  592. if %1 = mainmenu_gump
  593. return 3
  594. if %1 = normal_gump
  595. return 2
  596. if %1 = login_gump
  597. return 1
  598. if %1 = unknown
  599. return 0
  600. display ok unknown. Halting
  601. halt
  602. ;******************************************************************
  603. sub logout
  604. namespace push
  605. namespace local logout
  606. logout:
  607. set !timeOut #scnt + 5
  608. event macro 8 1
  609. wait 20
  610. waitpaperdoll:
  611. if #scnt > !timeOut
  612. goto logout
  613. if #contname <> paperdoll_gump
  614. goto waitpaperdoll
  615. contpos #clixres 0
  616. wait 20
  617. _waitConfirm:
  618. set !timeOut #scnt + 3
  619. set !paperDollX #clixres + 210
  620. click !paperDollX 110
  621. waitlogout:
  622. if #scnt > !timeOut
  623. goto _waitConfirm
  624. if #contname <> YesNo_gump
  625. goto waitlogout
  626. set !x #contposx + 120
  627. set !y #contposy + 90
  628. _quit:
  629. click !x !y
  630. set !timeOut #scnt + 20
  631. _waitlogout:
  632. if #scnt > !timeout
  633. goto quit
  634. if #contname <> MainMenu_gump
  635. goto _waitlogout
  636. namespace pop
  637. return
  638. ;******************************************************************
  639. sub recall
  640. namespace push
  641. namespace local recall
  642. recall:
  643. if %2 = recall
  644. {
  645. set !spell 31
  646. set !mana 11
  647. }
  648. if %2 = sacred
  649. {
  650. set !spell 210
  651. set !mana 10
  652. }
  653. set !rune %1
  654. set #ltargetkind 1
  655. set #ltargetid !rune
  656. set !x #charposx
  657. set !y #charposy
  658. _waitMana:
  659. if #mana < !mana
  660. goto _waitMana
  661. event macro 15 !spell
  662. wait 10
  663. target 5S
  664. event macro 22
  665. set !timeOut #scnt + 4
  666. _waitRecallLoop:
  667. scanjournal 1
  668. if blocking in #journal
  669. {
  670. namespace pop
  671. return #false
  672. }
  673. if reagents in #journal || fizzles in #journal
  674. {
  675. deletejournal
  676. wait 20
  677. goto _waitMana
  678. }
  679. if #scnt > !timeOut
  680. goto _waitMana
  681. if !x <> #charposx || !y <> #charposy
  682. {
  683. namespace pop
  684. return #true
  685. }
  686. goto _waitRecallLoop
  687. ;******************************************************************
  688. sub bod
  689. namespace push
  690. namespace local bod
  691. set !NPC %1
  692. BOD:
  693. finditem !npc
  694. if #findkind = -1
  695. {
  696. namespace pop
  697. return #false
  698. }
  699. gosub useVendor !npc %option
  700. if ! #result
  701. {
  702. namespace pop
  703. return #false
  704. }
  705. set !timeOut #scnt + 30
  706. _acceptBodLoop:
  707. scanjournal 1
  708. if an_offer_may in #journal
  709. {
  710. deletejournal
  711. wait 60s
  712. goto BOD
  713. }
  714. if #scnt > !timeOut
  715. goto BOD
  716. if #contname <> generic_gump
  717. goto _acceptBodLoop
  718. str pos #contsize _
  719. str del #contsize 1 #strres
  720. set !y 20 + #strres
  721. _bodRetry:
  722. click 165 !y
  723. wait 10
  724. if #contname = generic_gump
  725. goto _bodRetry
  726. namespace pop
  727. return #true
  728. ;******************************************************************
  729. sub bodBook
  730. namespace push
  731. namespace local bodBook
  732. set !X #cliXres - 200
  733. gosub opencont #backPackID !X #cliyres
  734. set #findmod 22_18
  735. finditem DYM C_ . #backpackID
  736. gosub moveitem #findid #findx #findy
  737. set !bookX #findx
  738. set !bookY #findy
  739. set #findmod 0_0
  740. wait 30
  741. findbodloop:
  742. finditem EYM C
  743. if #findkind = -1
  744. {
  745. namespace pop
  746. return
  747. }
  748. gosub moveitem #findid !bookX !bookY
  749. gosub _waitSysVar contname = generic_gump contsize = 615_454 2
  750. if #result
  751. click 610 40 r
  752. goto findbodloop
  753. ;******************************************************************
  754. sub rail
  755. namespace push
  756. namespace local rail
  757. set %endspot checker
  758. set !railName %1
  759. call !railName
  760. gosub checkNumber %endspot
  761. if ! #result
  762. {
  763. display ok there is something wrong with your rail ( !railName )$
  764. +check you have made the file and put it in the same folder as the bod script.$
  765. +halting script.
  766. halt
  767. }
  768. for !i 1 %ENDSPOT
  769. {
  770. set !x %x . !i
  771. set !y %y . !i
  772. set !z %z . !i
  773. gosub findDist !x !y #charposx #charposy
  774. if #result > 15
  775. {
  776. display ok the next spot is too far away$
  777. +I suggest you remake the rail$
  778. +try to keep the gap between each spot short ( 10 tiles is good )
  779. halt
  780. }
  781. set !tries 0
  782. tryAgain:
  783. if !tries > 10
  784. {
  785. gosub railFailMenu
  786. if #result
  787. {
  788. set !tries 0
  789. goto tryAgain
  790. }
  791. namespace pop
  792. return #false
  793. }
  794. set !pathfindTimeOut #scnt + 6
  795. event pathfind !x !y !z
  796. set !tries !tries + 1
  797. _waitmove:
  798. if #contname = generic_gump && #contsize = 420_280
  799. {
  800. click 330 360
  801. wait 10
  802. }
  803. IF #charposx = !x && #charposy = !y && #charposz = !z
  804. goto next
  805. if #scnt < !pathfindTimeOut
  806. goto _waitmove
  807. goto try_again
  808. next:
  809. }
  810. namespace pop
  811. return #true
  812. ;******************************************************************
  813. sub timeOld
  814. set %time *RazielBodTime
  815. set %date_old *RazielBodDate
  816. set %seconds_old ( %time % 100 ) + ( ( %time % 10000 ) / 100 ) * 60 + ( %time / 10000 ) * 3600
  817. set %date_new #date
  818.  
  819. if %time = N/A 2
  820. set %date_old #date
  821. set %seconds_old ( #time % 100 ) + ( ( #time % 10000 ) / 100 ) * 60 + ( #time / 10000 ) * 3600 - 3600 * %hoursBetweenBods
  822. return
  823. ;******************************************************************
  824. sub makeMenu
  825. menu clear
  826. set #menubutton N/A
  827. menu show 50 50
  828. menu Window Title Raziel's BOD Collection Script
  829. menu window color black
  830. menu font size 12
  831. menu font color red
  832. menu font bgcolor black
  833. menu Window Size 275 50
  834. menu text time 5 5 Time Untill next Bod run :$ , %h hours %m minutes
  835. menu button continue 165 25 105 20 Get Bods Now
  836. menu hideEUO
  837. return
  838. ;******************************************************************
  839. sub waitBod
  840. set %show #true
  841. _waitBOD:
  842. set %date_new #date
  843. set %seconds_new ( #time % 100 ) + ( ( #time % 10000 ) / 100 ) * 60 + ( #time / 10000 ) * 3600
  844. if %date_old <> %date_new
  845. set %get_bod 3600 * %hoursBetweenBods - ( ( %seconds_new - %seconds_old ) + 86400 )
  846. else
  847. set %get_bod 3600 * %hoursBetweenBods - ( %seconds_new - %seconds_old )
  848. if %get_bod <= 0
  849. return
  850. set %h %get_bod / 3600
  851. set %m ( %get_bod % 3600 ) / 60
  852. if %show
  853. {
  854. menu delete time
  855. menu text time 5 5 Time Untill next Bod run :$ , %h hours %m minutes
  856. if #menubutton = continue
  857. return
  858. if #menubutton = closed
  859. set %show #false
  860. }
  861. wait 20
  862. goto _waitBOD
  863. ;******************************************************************
  864. sub moveTo
  865. namespace push
  866. namespace local moveTo
  867. set !destination %1
  868. set !bodType %2
  869. set !recallOrRail %3
  870. if rail in !recallOrRail
  871. {
  872. set !tempRailName !recallOrRail
  873. str len !tempRailName
  874. set !len #strres - 4
  875. str mid !tempRailName 5 !len
  876. set !mod #strres
  877. set !recallOrRail rail
  878. }
  879. if !recallOrRail = recall || !recallOrRail = sacred
  880. {
  881. set !rune N/A
  882. _recallLoop:
  883. gosub findRune !destination !rune
  884. if #result = -1
  885. {
  886. display Ok Cannot find rune, please check rune name$ halting script
  887. halt
  888. }
  889. set !rune #result
  890. gosub recall !rune !recallOrRail
  891. if ! #result
  892. goto _recallLoop
  893. }
  894. if !recallOrRail = rail
  895. {
  896. if !destination = tailor
  897. set !railFile inn_tailor
  898. if !destination = smith && !bodType = 1
  899. set !railFile inn_smith
  900. if !destination = smith && !bodType = 2
  901. set !railFile tailor_smith
  902. if !destination = inn && !bodType = 0
  903. set !railFile tailor_inn
  904. if !destination = inn && ( !bodType = 1 || !bodType = 2 )
  905. set !railFile smith_inn
  906. set !railFile !railFile , !mod , .txt
  907. gosub rail !railFile
  908. if ! #result
  909. {
  910. namespace pop
  911. return #false
  912. }
  913. }
  914. if !destination <> inn
  915. {
  916. set !npc none
  917. _getBodLoop:
  918. gosub findNpc !destination !npc
  919. set !npc #result
  920. gosub BOD !npc
  921. if ! #result
  922. goto _getBodLoop
  923. }
  924. namespace pop
  925. return #true
  926. ;******************************************************************
  927. sub InfoMenu
  928. namespace push
  929. namespace local infoMenu
  930. set !account %1
  931. set !char %2
  932. set !recallOrRail %3
  933. if %4 = 0
  934. set !bodType Tailor
  935. if %4 = 1
  936. set !bodtype Smith
  937. if %4 = 2
  938. set !bodType Tailor , #spc , and , #spc , smith
  939. set !shard %5
  940. set !lines %0
  941. set !menuHeight 20 * !lines + 30
  942. menu clear
  943. menu show 600 600
  944. menu Window Title Raziel's BOD Collection Script
  945. menu window color black
  946. menu font size 12
  947. menu font color red
  948. menu font bgcolor black
  949. menu Window Size 275 !menuHeight
  950. menu text text 5 5 Gathering Bods
  951. menu text text 5 25 Account : !account
  952. menu text text 5 45 Character : !char
  953. menu text text 5 65 Movement : !recallOrRail
  954. menu text text 5 85 Bods : !bodtype
  955. if !lines = 5
  956. menu text text 5 105 Shard : !shard
  957. namespace pop
  958. return
  959. ;===============================
  960. ;* @name useVendor
  961. ;* @author Quintok
  962. ;* @ver 1.0 13 march 04
  963. ;* @purpose opens context menu and clicks the correct option
  964. ;* @param %1 vendor id
  965. ;* %2 which option to pick on the context menu
  966. sub useVendor
  967. namespace push
  968. namespace local Quintok
  969. set !useVendorCnt 0
  970. set !vendorID %1
  971. set !_contextOption %2
  972. set !VendorX -4
  973. set !VendorY -54
  974. _useVendorLoop:
  975. finditem !vendorID G
  976. if #findkind = -1
  977. {
  978. namespace pop
  979. return #false
  980. }
  981. gosub clickScreenXYZ #findx #findy #findz !vendorX !vendorY
  982. if paper_doll in #contname
  983. gosub clickScreenXYZ #findx #findy #findz !vendorX !vendorY
  984. gosub clickContextMenuOption !_contextOption
  985. if ! #result
  986. {
  987. set !useVendorCnt !useVendorCnt + 1
  988. if !useVendorCnt > 6
  989. {
  990. namespace pop
  991. return #false
  992. }
  993. set !VendorX !VendorX + 2
  994. set !VendorY !VendorY + 2
  995. goto _useVendorLoop
  996. }
  997. namespace pop
  998. return #true
  999. ;===============================
  1000. ;* Convert 3D world coordinates to 2D screen coordinates.
  1001. ;*
  1002. ;* @purpose Convert 3D world coordinates to 2D screen coordinates.
  1003. ;* @author the.WZA (namespace edit by Quintok)
  1004. ;* @param %1 worldx req World x-coordinate.
  1005. ;* %2 worldy req World y-coordinate.
  1006. ;* %3 worldz req World z-coordinate.
  1007. ;* @return %_cursorX and %_cursorY holds the screen coordinates.
  1008. ;* @see clickScreenXYZ checkScreenXY
  1009. sub worldXYZToScreenXY
  1010. set %1 ( %1 - #charPosX ) * 22
  1011. set %2 ( #charPosY - %2 ) * 22
  1012. set !_cursorX #cliLeft + #cliXRes / 2 + %1 + %2
  1013. set !_cursorY #cliTop + #cliYRes / 2 + %1 - %2 - ( %3 - #charPosZ ) * 4
  1014. return
  1015.  
  1016. ;===============================
  1017. ;* Clicks on the screen given by world coordinates (with displacement).
  1018. ;* Initialize the following variables: %_cursorX, %_cursorY.
  1019. ;*
  1020. ;* @purpose Clicks on the screen given by world coordinates (with displacement).
  1021. ;* @author ScriptFellow (namespace edit by Quintok)
  1022. ;* @param %1 worldx req World x-coordinate.
  1023. ;* %2 worldy req World y-coordinate.
  1024. ;* %3 worldz req World z-coordinate.
  1025. ;* %4 xdisp opt x displacement (to be added to the screen coordinate).
  1026. ;* %5 ydisp opt y displacement (to be added to the screen coordinate).
  1027. ;* %6 click1 opt click modifier: D, F, G, N, P, R or X (default if 'F')
  1028. ;* %7 click2 opt X modifier
  1029. ;* @return %outsideScreen (#true or #false )
  1030. ;* @see worldXYZToScreenXY checkScreenXY openContextMenu
  1031. sub clickScreenXYZ
  1032. if %0 < 4 || %4 = N/A
  1033. set !_dx 0
  1034. else
  1035. set !_dx %4
  1036. if %0 < 5 || %5 = N/A
  1037. set !_dy 0
  1038. else
  1039. set !_dy %5
  1040. if %0 < 6 || _ , %6 , _ notIn _D_F_G_N_P_R_X_
  1041. set !_clickType F
  1042. else
  1043. set !_clickType %6
  1044. gosub worldXYZToScreenXY %1 %2 %3
  1045. set !_cursorX !_cursorX + !_dx
  1046. set !_cursorY !_cursorY + !_dy
  1047. click !_cursorX !_cursorY !_clickType %clickMod
  1048. return
  1049. ;===============================
  1050. ;* @name waitFor
  1051. ;* @author Quintok
  1052. ;* @ver 1.0 13 march 04
  1053. ;* @purpose waits %4 seconds for # . %1 to %2 to %3
  1054. ;* @param %1 system variable without '#' (req)
  1055. ;* %2 operation ie = <> in notin (req)
  1056. ;* %3 to compare with ie abcdef (req)
  1057. ;* %4 timeout in seconds
  1058. sub waitFor
  1059. if %0 < 4
  1060. set !timeOut #scnt + 5
  1061. else
  1062. set !timeOut #scnt + %4
  1063. _waitForLoop:
  1064. if #scnt > !timeOut
  1065. return #false
  1066. if ! ( # . %1 %2 %3 )
  1067. goto _waitForLoop
  1068. return #true
  1069. ;===============================
  1070. ;* @name clickContextMenuOption
  1071. ;* @author Quintok
  1072. ;* @ver 1.0 13 march 04
  1073. ;* @purpose waits %4 seconds for # . %1 to %2 to %3
  1074. ;* @param %1 the number in the list
  1075. sub clickContextMenuOption
  1076. set !_vendorNumber %1
  1077. _clickContextMenuOptionLoop:
  1078. gosub waitfor contname = normal_gump 2
  1079. if ! #result && #contname = status_gump && #contID = !vendorID
  1080. {
  1081. set !x #contposx + 15
  1082. set !y #contposy + 15
  1083. click !x !y r
  1084. goto _clickContextMenuOptionLoop
  1085. }
  1086. if ! #result
  1087. return #false
  1088. gosub _ensureContextSize !_vendorNumber
  1089. if ! #result
  1090. return #false
  1091. set !x #contposx + 25
  1092. set !y #contposy + ( 18 * !_vendorNumber )
  1093. click !x !y f
  1094. return #true
  1095. ;===============================
  1096. ;* @name _ensureContextSize [internal]
  1097. ;* @author Quintok
  1098. ;* @ver 1.0 13 march 04
  1099. ;* @purpose make sure context menu could hold atleast %1 options
  1100. ;* @param %1 the number in the list
  1101. sub _ensureContextSize
  1102. str pos #contsize _
  1103. set !right #strres - 1
  1104. str right #contsize !right
  1105. set !contsize #strres
  1106. if !contsize < ( 24 + 18 * %1 )
  1107. return #false
  1108. return #true
  1109. ;******************************************************************
  1110. sub sortDeskTop
  1111. namespace push
  1112. namespace local sortDeskTop
  1113. if #clileft <> 0
  1114. set #clileft 0
  1115. if #clitop <> 0
  1116. set #clitop 0
  1117. _minStatus:
  1118. event macro 8 2
  1119. wait 10
  1120. event macro 10 2
  1121. gosub _waitSysVar contname = status_gump contsize = 432_184 5
  1122. if ! #result
  1123. goto _minStatus
  1124. _moveStatus:
  1125. contpos 250 #cliYres
  1126. gosub _waitSysVar contname = status_gump contsize = 432_184 contposx = 250 contposy = #cliYres 5
  1127. if ! #result
  1128. goto _moveStatus
  1129. _openBackPack:
  1130. event macro 8 7
  1131. gosub _waitSysVar contname = container_gump contsize = 230_204 5
  1132. if ! #result
  1133. goto _openBackPack
  1134. _moveBackPack:
  1135. set !X #cliXres - 180
  1136. contpos !X #cliYres
  1137. gosub _waitSysVar contname = container_gump contsize = 230_204 contposX = !X contposY = #cliYres 5
  1138. if ! #result
  1139. goto _moveBackPack
  1140. wait 10
  1141. _openPaperDoll:
  1142. event macro 8 1
  1143. gosub _waitSysVar contname = paperdoll_gump contid = #charid 5
  1144. if ! #result
  1145. goto _openPaperDoll
  1146. _movePaperDoll:
  1147. contpos #cliXres 0
  1148. gosub _waitSysVar contname = paperdoll_gump contid = #charid contposX = #cliXres contposY = 0 5
  1149. if ! #result
  1150. goto _movePaperDoll
  1151. namespace pop
  1152. return
  1153. ;******************************************************************
  1154. sub cancelRewards
  1155. _closeVetGump:
  1156. click 300 105
  1157. wait 10
  1158. gosub _waitSysVar contname = generic_gump contsize = 510_145 2
  1159. if #result
  1160. {
  1161. contpos 0 0
  1162. goto _closeVetGump
  1163. }
  1164. _closeAOSGift:
  1165. click 75 470
  1166. wait 10
  1167. gosub _waitSysVar contname = generic_gump contsize = 520_440 2
  1168. if #result
  1169. {
  1170. contpos 50 50
  1171. goto _closeAOSGift
  1172. }
  1173. return
  1174. ;******************************************************************
  1175. sub moveItem
  1176. namespace push
  1177. namespace local moveItem
  1178. set !subTimeOut #scnt + 30
  1179. set !item %1
  1180. set !x %2
  1181. set !y %3
  1182. set !amount %4
  1183. set !0 %0
  1184. finditem !item
  1185. if #findkind = -1
  1186. {
  1187. ignoreitem !item
  1188. finditem !item
  1189. if #findkind = -1
  1190. {
  1191. namespace pop
  1192. return #false
  1193. }
  1194. ignoreitem !item
  1195. }
  1196. _dragAgain:
  1197. if !subTimeOut < #scnt
  1198. {
  1199. namespace pop
  1200. return #false
  1201. }
  1202. set !timeOut #scnt + 4
  1203. wait 10
  1204. event drag !item
  1205. _waitDrag:
  1206. if #scnt > !timeOut
  1207. goto _dragAgain
  1208. if #contname notin stack_gump_drag_gump
  1209. goto _waitDrag
  1210. if #contname = stack_gump && !0 = 4
  1211. msg !amount $
  1212. if #contname = stack_gump && !0 < 4
  1213. msg $
  1214. set !timeOut #scnt + 4
  1215. _waitDragging:
  1216. if #scnt > !timeOut
  1217. goto _dragAgain
  1218. if #contname <> drag_gump
  1219. goto _waitDragging
  1220. click !x !y p
  1221. namespace pop
  1222. return #true
  1223. ;***************************************************************************************************
  1224. sub checkNumber
  1225. if %1 * 1 / %1 = 1 || %1 = 0
  1226. return #true
  1227. return #false
  1228. ;******************************************************************
  1229. sub checkBodCycleLine
  1230. set %lines 0
  1231. if %6 > 5 || %6 < 4
  1232. set %lines %lines + 2
  1233. if %1
  1234. set %lines %lines + 1
  1235. if %2
  1236. set %lines %lines + 1
  1237. if %3
  1238. set %lines %lines + 1
  1239. if %_3 = sacred
  1240. set %lines %lines + 1
  1241. if %4
  1242. set %lines %lines + 2
  1243. if %_0 = 5 && %5
  1244. set %lines %lines + 1
  1245. if %lines = 0
  1246. return #true
  1247. set %ySize 105 + %lines * 16
  1248. menu Clear
  1249. menu Window Title BodCycle Error Checking
  1250. menu Window Color None
  1251. menu Window Size 500 %ySize
  1252. menu Font Transparent #true
  1253. menu Font Align Right
  1254. menu Shape EUOShape1 0 52 390 45 3 7 1 Black 7 Red
  1255. menu Font Name MS Sans Serif
  1256. menu Font Size 8
  1257. menu Font Style
  1258. menu Font Color Red
  1259. menu Font Transparent #false
  1260. menu Font Align Left
  1261. menu Font BGColor None
  1262. menu Text EUOLabel1 4 4 You are seeing this menu because one or more of the parameters you put in the bodcycle line have errors
  1263. menu Text EUOLabel2 4 20 This will hopefully show you what you've done wrong and what you need to change
  1264. menu Text EUOLabel3 4 36 The bold yellow parts have errors
  1265. menu Text EUOLabel10 4 80 Gosub bodCycle
  1266. menu Text EUOLabel11 4 68 Your Line:
  1267. menu Font Color WindowText
  1268. menu Font BGColor Red
  1269. menu Text EUOLabel4 4 56 Gosub bodCycle
  1270. menu Text EUOLabel10 4 80 Gosub bodCycle
  1271. menu Text EUOLabel11 4 68 Your Line:
  1272. menu Font Style
  1273. menu Font Color
  1274. menu Text EUOLabel5 88 56 Account
  1275. menu Text EUOLabel6 136 56 Char
  1276. menu Text EUOLabel7 164 56 rail|recall
  1277. menu Text EUOLabel8 220 56 { 0 1 2 }
  1278. menu Text EUOLabel9 272 56 [Shard]
  1279. menu Text EUOLabel12 88 80 %_1
  1280. menu Text EUOLabel13 136 80 %_2
  1281. menu Text EUOLabel14 164 80 %_3
  1282. menu Text EUOLabel15 220 80 %_4
  1283. if %6 <> 4
  1284. menu Text EUOLabel16 272 80 %_5
  1285. menu Font Style b
  1286. menu Font Color Yellow
  1287. if %1
  1288. {
  1289. menu delete EUOlabel5
  1290. menu delete EUOlabel12
  1291. menu Text EUOLabel5 88 56 Account
  1292. menu Text EUOLabel12 88 80 %_1
  1293. }
  1294. if %2
  1295. {
  1296. menu delete EUOlabel6
  1297. menu delete EUOlabel13
  1298. menu Text EUOLabel6 136 56 Char
  1299. menu Text EUOLabel13 136 80 %_2
  1300. }
  1301. if %3
  1302. {
  1303. menu delete EUOlabel7
  1304. menu delete EUOlabel14
  1305. menu Text EUOLabel7 164 56 rail|recall
  1306. menu Text EUOLabel14 164 80 %_3
  1307. }
  1308. if %4
  1309. {
  1310. menu delete EUOlabel8
  1311. menu delete EUOlabel15
  1312. menu Text EUOLabel8 220 56 { 0 1 2 }
  1313. menu Text EUOLabel15 220 80 %_4
  1314. }
  1315. if %5
  1316. {
  1317. menu delete EUOlabel9
  1318. menu delete EUOlabel16
  1319. menu Text EUOLabel9 272 56 [Shard]
  1320. if %6 <> 4
  1321. menu Text EUOLabel16 272 80 %_5
  1322. }
  1323. menu Font Color WindowText
  1324. menu Button Skip 400 48 100 25 Skip Character
  1325. menu Button halt 400 75 100 25 Halt Script
  1326.  
  1327. set %yPos 105
  1328. menu Font Style
  1329. menu Font Color Red
  1330. menu Font BGColor None
  1331. if %6 > 5 || %6 < 4
  1332. {
  1333. menu text advice 4 %yPos You have given an invalid number of parameters ( %6 ).
  1334. set %yPos %yPos + 16
  1335. menu text advice 4 %yPos There should be max 5 and min 4, please re-read the instructions
  1336. set %yPos %yPos + 16
  1337. }
  1338. if %1
  1339. {
  1340. menu text advice 4 %yPos The Account you specified was not a number, please re-read the instructions
  1341. set %yPos %yPos + 16
  1342. }
  1343. if %2 && %_2 < 6
  1344. {
  1345. menu text advice 4 %yPos The Character you specified was not a number, please re-read the instructions
  1346. set %yPos %yPos + 16
  1347. }
  1348. if %2 && %_2 > 6
  1349. {
  1350. menu text advice 4 %yPos The character you specified is invalid ( character %_2 ).
  1351. set %yPos %yPos + 16
  1352. }
  1353. if %3
  1354. {
  1355. menu text advice 4 %yPos The movement method you specified was invalid, please choose either rail or recall
  1356. set %yPos %yPos + 16
  1357. }
  1358. if %_3 = sacred
  1359. {
  1360. menu text advice 4 %yPos To use sacred journey please choose recall, the script will then use sacred journey
  1361. set %yPos %yPos + 16
  1362. }
  1363. if %4
  1364. {
  1365. menu text advice 4 %yPos The bod type to collect was invalid ( %_4 ), please choose only 0, 1 or 2.
  1366. set %yPos %yPos + 16
  1367. menu text advice 4 %yPos 0 = smith only, 1 = tailor only, 2 = both smith and tailor.
  1368. set %yPos %yPos + 16
  1369. }
  1370. if %5
  1371. {
  1372. menu text advice 4 %yPos The shard you specified was a number.
  1373. }
  1374. menu Show 421 270
  1375. set #menubutton N/A
  1376. _menuLoop:
  1377. if #menubutton = halt
  1378. halt
  1379. if #menubutton = skip
  1380. return #false
  1381. goto _menuLoop
  1382. ;******************************************************************
  1383. sub findDist
  1384. namespace push
  1385. namespace local findDist
  1386. set !x abs ( %1 - %3 )
  1387. set !y abs ( %2 - %4 )
  1388. set #result !y
  1389. if !x > !y
  1390. set #result !x
  1391. namespace pop
  1392. return #result
  1393. ;******************************************************************
  1394. sub railFailMenu
  1395. set %TimeUp #scnt + 300
  1396. set %timeRem %TimeUp - #scnt
  1397. menu Clear
  1398. menu Window Title Rail Move failed
  1399. menu Window Color Black
  1400. menu Window Size 335 125
  1401. menu Font Transparent #true
  1402. menu Font Align Right
  1403. menu Shape EUOShape1 0 0 345 69 3 7 1 Black 7 Yellow
  1404. menu Font Name MS Sans Serif
  1405. menu Font Size 8
  1406. menu Font Style
  1407. menu Font Color Red
  1408. menu Font Transparent #false
  1409. menu Font Align Left
  1410. menu Font BGColor Yellow
  1411. menu Text EUOLabel1 4 4 For some reason rail movement has failed
  1412. menu Text EUOLabel2 4 20 You can either move yourself manually to the next spot and try again
  1413. menu Text EUOLabel3 4 36 or the script will logout in 5 mins time, wait 5 mins for the char to timeout.
  1414. menu Text EUOLabel4 4 52 then login with any remaining characters.
  1415. menu Font Size 14
  1416. menu Font Style b
  1417. menu Font Color Yellow
  1418. menu Font BGColor Black
  1419. menu Text EUOLabel5 85 72 What Will You Do?
  1420. menu Font Size 8
  1421. menu Font Style
  1422. menu Font Color WindowText
  1423. menu Font BGColor InactiveBorder
  1424. menu Button tryAgain 15 96 150 25 Try Again
  1425. menu Button skipChar 180 96 150 25 Skip Character ( %timeRem s )
  1426. menu Show 421 270
  1427. set #menubutton N/A
  1428. _railFailMenuLoop:
  1429. menu delete skipChar
  1430. menu Button skipChar 180 96 150 25 Skip Character ( %timeRem s )
  1431. if #menubutton = tryAgain
  1432. {
  1433. menu hide
  1434. return #true
  1435. }
  1436. if #menubutton = skipChar || %timeRem < 0
  1437. {
  1438. menu hide
  1439. return #false
  1440. }
  1441. set %timeRem %TimeUp - #scnt
  1442. wait 1s
  1443. goto _railFailMenuLoop
  1444. ;******************************************************************
  1445. sub loginFailMenu
  1446. set %TimeUp #scnt + 60
  1447. set %timeRem %TimeUp - #scnt
  1448. menu Clear
  1449. menu Window Title Login Fail Menu
  1450. menu Window Color Black
  1451. menu Window Size 373 122
  1452. menu Font Transparent #true
  1453. menu Font Align Right
  1454. menu Shape EUOShape1 0 0 376 69 3 7 1 Black 7 Yellow
  1455. menu Font Name MS Sans Serif
  1456. menu Font Size 8
  1457. menu Font Style
  1458. menu Font Color Red
  1459. menu Font Transparent #false
  1460. menu Font Align Left
  1461. menu Font BGColor Yellow
  1462. menu Text EUOLabel1 4 4 For some reason login has failed. It will wait 1 minute and then try again
  1463. menu Text EUOLabel2 4 20 After 5 attemps it will skip this character. ( current attemps = %loginAttemps ).
  1464. menu Text EUOLabel3 4 36 You may login manually and then click the "login manually" button to continue
  1465. menu Text EUOLabel4 4 52 or use the skip/try again buttons.
  1466. menu Font Size 12
  1467. menu Font Style b
  1468. menu Font Color Yellow
  1469. menu Font BGColor Black
  1470. menu Text EUOLabel5 100 72 What Will You Do?
  1471. menu Font Size 8
  1472. menu Font Style
  1473. menu Font Color WindowText
  1474. menu Font BGColor BtnFace
  1475. menu Button tryagain 10 96 112 25 Try Again ( %timeRem s )
  1476. menu Button manual 254 96 112 25 Login Manually
  1477. menu Button skip 132 96 112 25 Skip Character
  1478. menu Show 421 270
  1479. set #menubutton N/A
  1480. _loginFailMenuLoop:
  1481. menu delete tryagain
  1482. menu Button tryagain 10 96 112 25 Try Again ( %timeRem s )
  1483. if #menubutton = tryagain || %timeRem < 0
  1484. return tryagain
  1485. if #menubutton = skip
  1486. return skip
  1487. if #menubutton = manual
  1488. return manual
  1489. set %timeRem %TimeUp - #scnt
  1490. wait 1s
  1491. goto _loginFailMenuLoop
  1492. ;***************************************************************************************************
  1493. sub OpenCont
  1494. ;%1 = id %2 = x pos %3 = y pos
  1495. namespace push
  1496. namespace local OpenCont
  1497. set !contPos #false
  1498. set !container %1
  1499. if %0 = 3
  1500. {
  1501. set !xCont %2
  1502. set !yCont %3
  1503. set !contPos #true
  1504. }
  1505. gosub checkRange !container
  1506. if ! #result
  1507. {
  1508. namespace pop
  1509. return #false
  1510. }
  1511. set !timeOut #scnt
  1512. _openContLoop:
  1513. set #lobjectid !container
  1514. if #scnt > !timeOut
  1515. {
  1516. event macro 17
  1517. set !timeOut #scnt + 3
  1518. }
  1519. if #contid <> !container
  1520. goto _openContLoop
  1521. if ! !contPos
  1522. {
  1523. namespace pop
  1524. return #true
  1525. }
  1526. _openContAt:
  1527. contpos !xCont !yCont
  1528. wait 10
  1529. if #contposx <> !xCont && #contposy <> !yCont
  1530. goto _openContAt
  1531. namespace pop
  1532. return #true
  1533. ;***************************************************************************************************
  1534. sub checkRange
  1535. namespace push
  1536. namespace local checkRange
  1537. set !item %1
  1538. _rangeloop:
  1539. finditem !item
  1540. if #findkind = -1
  1541. {
  1542. namespace pop
  1543. return #false
  1544. }
  1545. if #findkind = 1 && #finddist <= 2 && abs ( #charposz - #findz ) < 20
  1546. {
  1547. namespace pop
  1548. return #true
  1549. }
  1550. if #findkind = 1
  1551. {
  1552. namespace pop
  1553. return #false
  1554. }
  1555. set !item #findbagid
  1556. goto _rangeloop
  1557. ;***************************************************************************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement