Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;===MANDATORY CONFIG===
- ;Position of a container in the bank box (Bank will awasly open op position x:10 y:10
- SET %bankBagx 82
- SET %bankBagY 157
- ;Mining delay in seconds of your shard ( recomended to add +1 second)
- SET %miningDelay 11
- SET %timeoutRelog 30
- ;Go to bank when Weight reaches ...
- ;Put 0 to disable bank
- SET %maxMiningWeight 250
- ;IF you fail to mine a tile, perhaps it contains good ore. But IF your mining skill is
- ;too low you will be only wasting time.
- ;recomended to turn on only after 70.0%
- SET %persist 0
- ;===OPTIONAL CONFIG===
- ;Ores and gems (need to add more gems)
- SET %ores DWJ_TVJ_GWJ_EWJ_BVF
- ;Pickaxe and shovel
- SET %miningTool NPF_QPF
- SET %timeOut #SCNT
- GOSUB relog
- GOSUB intro
- GOSUB preValidations
- GOSUB setGumps
- GOSUB setForMining
- SET %posToMine 0
- GOSUB journalScan
- ;========= FUNCTIONS ================
- SUB relog
- EVENT sysmessage --> entrou relog
- ;IF #SCNT - %timeOut >= %timeoutRelog
- {
- GOSUB RELOGAR
- }
- RETURN
- ;Main loop inside this function
- SUB journalScan
- SET %jrnl #jindex
- GOSUB mine
- while #true
- {
- IF #jindex > %jrnl
- {
- SET %jrnl %jrnl + 1
- scanjournal %jrnl
- IF There_is_nothing_here_to_mine_for in #journal
- {
- GOSUB setForMining
- GOSUB mine
- }
- IF Try_mining_elsewhere in #journal
- {
- GOSUB setForMining
- GOSUB mine
- }
- IF That_is_too_far_away in #journal
- {
- GOSUB setForMining
- GOSUB mine
- }
- IF You_have_no_line_of_sight_to_that_location in #journal
- {
- GOSUB setForMining
- GOSUB mine
- }
- IF You_cannot_mine_so_close_to_yourself in #journal
- {
- GOSUB setForMining
- GOSUB mine
- }
- IF You_loosen_some_rocks_but_fail_to_find_any_useable_ore in #journal
- {
- IF %persist = 0
- GOSUB setForMining
- GOSUB mine
- }
- IF You_put in #journal
- {
- EVENT sysmessage --> YEAH ! ORES ...
- GOSUB mine
- }
- IF #SCNT - %timeOut >= %miningDelay
- {
- SET %jrnl #jindex
- SET %t #SCNT - %timeOut
- EVENT sysmessage --> TIMEOUT %t
- GOSUB setForMining
- GOSUB mine
- }
- IF #WEIGHT >= %maxMiningWeight && %maxMiningWeight <> 0
- {
- GOSUB MineToBank
- GOSUB OreToBank
- GOSUB BankToMine
- GOSUB setForMining
- GOSUB mine
- }
- }
- }
- RETURN
- SUB walk
- SET %walkDirection #random % 8
- GOSUB %walkDirection 2
- MOVE #ltargetx #ltargety 0 2s
- ;SET %walkDirection %walkDirection + 1
- ;IF %walkDirection > 7
- ;{
- ; SET %walkDirection 0
- ;}
- RETURN
- SUB 0
- SET #ltargetx #charposx
- SET #ltargety #charposy - %1
- RETURN
- SUB 1
- SET #ltargetx #charposx + %1
- SET #ltargety #charposy - %1
- RETURN
- SUB 2
- SET #ltargetx #charposx + %1
- SET #ltargety #charposy
- RETURN
- SUB 3
- SET #ltargetx #charposx + %1
- SET #ltargety #charposy + %1
- RETURN
- SUB 4
- SET #ltargetx #charposx
- SET #ltargety #charposy + %1
- RETURN
- SUB 5
- SET #ltargetx #charposx - %1
- SET #ltargety #charposy + %1
- RETURN
- SUB 6
- SET #ltargetx #charposx - %1
- SET #ltargety #charposy
- RETURN
- SUB 7
- SET #ltargetx #charposx - %1
- SET #ltargety #charposy - %1
- RETURN
- SUB setForMining
- ; Reset variables in case you CLICK with your mouse
- SET #LTARGETID 0
- SET #LTARGETZ 0
- SET #LTARGETKIND 2
- ; SET mining position
- GOSUB %posToMine 1
- ; Increment mining spot
- SET %posToMine %posToMine + 1
- ; IF last stop reached
- IF %posToMine > 7
- {
- SET %posToMine 0
- GOSUB walk
- }
- RETURN
- SUB mine
- SET %timeOut #SCNT
- FINDITEM %miningTool
- SET #LOBJECTID #FINDID
- EVENT macro 17 0 ; uses last object
- target 3s ; WAIT for target cursor
- EVENT macro 22 0 ; last target
- GOSUB relog
- RETURN
- SUB intro
- EVENT sysmessage --> Mining macro by BELZEBOSS
- EVENT sysmessage --> TFG shard 2017/10/16
- EVENT sysmessage --> Screen resolution 1920x1080
- RETURN
- SUB setGumps
- EVENT macro 8 3 ;open journal
- WAIT 7
- contpos 635 13 ;moves to position
- WAIT 7
- EVENT macro 8 4 ;open journal
- WAIT 10
- contpos 800 13 ;moves to position
- WAIT 7
- EVENT macro 8 1 ;Open Paperdoll
- WAIT 7
- contpos 500 -45 ;moves you paperdoll to Position
- WAIT 7
- EVENT macro 8 7 ;Open Backpack
- WAIT 10
- contpos 546 300 ;moves it to Position
- WAIT 7
- EVENT macro 8 8 ;Open Overview
- EVENT macro 8 8 ;Open Overview
- WAIT 7
- contpos 530 500 ;moves you overview to position
- WAIT 7
- EVENT macro 8 2 ;Open Statusbar
- WAIT 7
- ;EVENT macro 10 2 ;minimize Statusbar
- ; WAIT 5
- contpos 570 450 ;moves you Statusbar to position
- WAIT 7
- RETURN
- SUB preValidations
- FINDITEM %miningTool C_ , #BACKPACKID ;Finds pickaxe in your bag
- IF #findKind = -1
- {
- FINDITEM %miningTool C_ , #CHARID ;Finds pickaxe in your paperdoll
- IF #findKind = -1
- {
- EVENT sysmessage --> NO MINING TOOL FOUND. MACRO ABORTED
- GOSUB RELOGAR
- HALT
- }
- }
- RETURN
- SUB OreToBank
- nextCPos 10 10
- msg ! Banker Bank $
- WAIT 1s
- __AGAIN:
- FINDITEM %ores C , #BACKPACKID
- EVENT drag #findId
- WAIT 15
- IF #findstack > 1
- {
- MSG $
- WAIT 15
- }
- CLICK %bankBagx %bankBagy p
- WAIT 15
- IF #Findkind <> -1
- GOTO __AGAIN
- RETURN
- SUB MineToBank
- GOSUB pathFind 2579 475 0
- GOSUB pathFind 2571 478 0
- GOSUB pathFind 2567 484 0
- GOSUB pathFind 2559 491 0
- GOSUB pathFind 2558 501 0
- GOSUB pathFind 2553 504 14
- GOSUB pathFind 2547 501 30
- GOSUB pathFind 2536 500 30
- GOSUB pathFind 2525 505 15
- GOSUB pathFind 2528 515 0
- GOSUB pathFind 2529 526 0
- GOSUB pathFind 2524 536 0
- GOSUB pathFind 2518 540 0
- GOSUB pathFind 2512 545 0
- RETURN
- SUB BankToMine
- GOSUB pathFind 2524 536 0
- GOSUB pathFind 2529 526 0
- GOSUB pathFind 2528 515 0
- GOSUB pathFind 2525 505 15
- GOSUB pathFind 2536 500 30
- GOSUB pathFind 2547 501 30
- GOSUB pathFind 2553 504 9
- GOSUB pathFind 2558 501 0
- GOSUB pathFind 2559 491 0
- GOSUB pathFind 2567 484 0
- GOSUB pathFind 2571 478 0
- GOSUB pathFind 2579 475 0
- RETURN
- SUB pathFind
- REPEAT
- ;try to avoid getting stuck when something is on that particular tile
- IF #RANDOM % 2 = 0
- {
- SET %fPathx %1 + 1
- SET %fPathy %2 - 1
- EVENT pathFind %fPathx %fPathy %3
- }
- ELSE
- {
- EVENT pathFind %1 %2 %3
- }
- WAIT 10
- UNTIL #CHARPOSX = %1 && #CHARPOSY = %2
- RETURN
- SUB RELOGAR
- EVENT sysmessage --> entrou relogar
- Set %password sword0035
- Set #Result N/A
- ClickAccept:
- If ( #contSize <> 203_121 ) && ( #contName <> waiting_gump )
- Goto ClickAccept
- Wait 10
- Key Enter
- Gosub WaitGump MainMenu_gump
- Goto EnterPass
- EnterPass:
- Click 384 399
- Wait 10
- Msg %password
- Wait 100
- Key Enter
- Set %TimeOut #Scnt + 12
- Goto WaitShardScreen
- WaitShardScreen:
- If #Scnt > %TimeOut
- Goto ErrorShard
- If ( #contSize <> 640_480 ) && ( #contName <> normal_gump )
- Goto WaitShardScreen
- Goto ChooseShard
- ChooseShard:
- Click 190 430
- Set %TimeOut #scnt + 12
- Goto WaitCharScreen
- WaitCharScreen:
- If #Scnt > %TimeOut + 10
- Goto ErrorChar
- If ( #contSize <> 640_480 ) && ( #contName = normal_gump )
- Goto ChooseChar
- If ( #contSize <> 640_480 ) && ( #contName <> Login_gump )
- Goto WaitCharScreen
- ChooseChar:
- Wait 10
- Click 361 165 d f x 4
- Set %TimeOut #Scnt + 12
- Goto WaitToBeInWorld
- WaitToBeInWorld:
- If #Scnt > %TimeOut
- Goto ErrorWorld
- If #cliLogged = 1 3
- Wait 100
- Set #Result #True
- Exit
- Goto WaitToBeInWorld
- ErrorShard:
- If ( #contSize <> 356_212 ) && ( #contName <> waiting_gump )
- Halt
- Key enter
- Gosub WaitGump MainMenu_gump
- Click 518 404
- Wait 10
- For %pass 0 15
- {
- key back
- wait 5
- }
- Goto EnterPass
- ErrorChar:
- Halt
- ErrorWorld:
- Halt
- Sub WaitGump
- Set %_TimeOut #Scnt + 10
- WaitGump:
- If #Scnt > %_TimeOut
- Return
- If #contName = %1
- Return
- Goto WaitGump
- RETURN
- --
- Francesco Salaris
- 54-9.8112-6010
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement