Easuo minning Sayfaya git: 1, 2, Sonraki |
Ultima Online Forum -> Kütüphane |
Yazar
Mesaj
ucanmanda6 yazmış:
sürüm farkından dolayı olabilir scriptte tinker tool ile ilgili satırı bulup ordaki numaraları shovel yapacak şekilde ayarlayabilirsen düzeleceğini umuyorum.
geçen gün aradım bulamadım farklı şekilde yapılmış kordinat felan gordum yapamadım bıraz ugrastım
Spoiler:
Yulrinn yazmış:
scriptini paylasirsan duzeltebilirim
;==================================
; Script Name: Runebook Mining
; Author: Spewy
; Version: 3.5
; Client Tested with: 5.0.1c
; EUO version tested with: 1.5 build 62
; Shard OSI / FS: OSI Tested
; Revision Date: October 19th, 2005
; Public Release: September 16th, 2003
; Purpose: Efficient mining with the use of runebooks and pack animal
;==================================
GoSub InitializeRuneBookMiningBySpewy ; Do not change/remove this line
Set %UseInteractiveSetup #true ; ******* Set to #false to manually set the values for variables ******
If %UseInteractiveSetup
GoSub InteractiveDefaults
; ********* MANUAL ENTRY OF VARIABLES ***************
If ! %UseInteractiveSetup
{
LinesPerCycle %lpsFast
;*********** REQUIRED Variables ******************
; ---------- Backpacks and Home Base Setup ----------
Set %BaseRunebook XXXXXXX ; Set this to the ID of your House or Bank Runebook
Set %NumBaseRunes 2 ; *** NEW *** Set the Total Number of Base runes to randomly use
Set %BaseRune1 5 ; The position of the house/bank rune in the runebook (1=First rune, 16=last rune)
Set %BaseRune2 6 ; An alternative rune just in case your first one is blocked (1=First rune, 16=last rune)
; For House Drop-off
Set %SecureId XXXXXXX ; Set to your HOUSE Secure ID (best if on stairs 2 squares away from recall spot)
Set %BankDrop #false ; Drop ore at the bank? #true = Bank, #false = House (Default)
Set %OreBagId XXXXXXX ; Set to the backpack id INSIDE your bank or house secure (Needed: House and Bank)
;---------- Mining Runebook Setup --------------------
; GoSub AddRunebook <RuneBook ID> <# of Mining Runes> [Color] [External Definition Filename]
; GoSub AddRunebook XXXXXXX 16
; Examples: (!!! Make sure you delete the semicolon ';' !!!) (!!! Filename must not contain spaces !!!)
; GoSub AddRunebook XXXXXXX 14 %Valorite SpewRunes.euo
; GoSub AddRunebook XXXXXXX 11 %Verite SpewRunes.euo
; GoSub AddRunebook XXXXXXX 16 %Agapite SpewRunes.euo
; *** LOOK FOR *** SetDigLocations subroutine to enter your mining locations
;********* OPTIONAL Variables *********
;---------- Bonded Packhorse/Packllama Setup ----------
Set %UsePackAnimal #false ; Use #true to use a bonded pack animal, #false otherwise
Set %PackAnimalId XXXXXXX ; The pack animal ID (use a dagger on it and look at #lTargetId)
Set %PackAnimalBagId XXXXXXX ; The Container ID of the pack animal backpack (Open Pack and use #ContId value)
Set %PackAnimalDropId XXXXXXX ; Backpack INSIDE pack animal backpack where the ore will be unloaded
;---------- Miscellaneous Variables ----------
Set %MaxWeight 360 ; Set this to the weight you would like to stop digging at 400 for trammel 380 for felluca
Set %RegSuit #false ; #false = Restock regeants, #true = Do not need regeants
Set %MineUseTime 15 ; Time between shovel usage is much smaller (For 'You must wait...' messages while mining set this higher)
Set %UseTime 23 ; The wait between item usage other than shovels (For 'You must wait...' message when not mining set this higher)
Set %HideMineInFel #true ; *** NEW *** Hide when mining in Feluca only
Set %HideMineElsewhere #false ; *** NEW *** Hide when mining even when not in Fel
Set %HideWhileManaWait #true ; *** NEW *** Hide when you are waiting for mana to regenerate
Set %HideOnPackUnload #true ; *** NEW *** Hide when you unload to the pack animal
Set %HideOnBaseUnload #true ; *** NEW *** Hide when you unload to your bank/house
Set %ShowStatus #true ; Show the status window while mining (Really should be #true, pause/escape button are on the status window)
Set %MinShovels 2 ; Set to the minimum number of shovels to carry when leaving Bank/House (Use up all those damn sturdy shovels)
Set %UseTinkering #true ; In case you don't have enough tinkering to make shovels (Make sure you set %MinShovels
Set %MakeTwoShovels #true ; Make 2 shovels when you have to make a shovel
Set %UseAnyColourIngot #false ; *** NEW *** Change this to true if you want the script to pickup coloured ingots from your bank/secure to tinker with
Set %TravelMethod 0 ; *** NEW *** Change this to True for Magery, False for Chivalry
Set %GiveUpTime 20 ; # of *seconds* of no successful mining strikes before script moves to the next mining spot
;---------- Walking directions to House Secure after Recall ---------------
Set %StandLocationX 0 ; Set these three variables to #CharPosX, #CharPosY, #CharPosZ when you have your
Set %StandLocationY 0 ; character standing in the spot close enough to unload the ore
Set %StandLocationZ -1
Set %DoorID XXXXXXX ; To use a door heading to %StandLocation, provide the ID of the door (double click door, use #LObjectID)
Set %DoorUseX 0 ; Set these three variables to #CharPosX, #CharPosY, #CharPosZ when you have your
Set %DoorUseY 0 ; character standing in the spot close enough open the door
Set %DoorUseZ -1
;---------- Enemy Detection and Evasion ---------------
Set %RedEscape #true ; Run the escape sequence if a red is detected
Set %RedCheckNPC #false ; Take extra time to see if Red found is a Red Healer
Set %TrackPackAnimal #true ; If your pack animal (if used) moves away from you, the escape sequence is run
Set %EscapeOnMonsterSighting #true ; #true: When a monster targets you, the script will try to escape (even before damage is done)
Set %HighThreatMonster N/A ; Upon the sighting of the specified monsters you will immediately try to escape
Set %NoThreatMonster GD ; (Corpsers, Reapers) Specified monsters will not cause an escape attempt (will still escape on damage)
Set %PauseAfterEscape #false
Set %EscapeOnDamage #true ; #true: Run the Escape sequence when you take more than %DamageThreshold damage
Set %DamageThreshold 10 ; the amount of damage before the escape is triggered [Fixes the escape problem caused by items that increase Hit Points]
Set %EscapeRecallTarget XXXXXXX ; ID of runebook or rune to target when you click on the ESCAPE button.
; Leave as is and script will open house runebook and recall from there
; Spewy sets this to %BaseRunebook and in UO sets the runebook default rune to be the house rune.
Set %MinutesBeforeReturn 20 ; Minutes to avoid the dangerous rune location (NOT TESTED, PLEASE POST IF IT WORKS)
Set %CureWithMagery #true ; Attempts to cast Cure after an escape attempt (after you press Run Macro after the pause)
Set %GrHealAfterEscape #true ; Attempts to cast Greater Heal after an escape attempt (after you press Run Macro after the pause)
Set %WaitForMana #true ; Make sure you have enough mana to recall to and recall out of a mining location (32 mana)
Set %MountBeforeRecall #true ; #true to mount your beetle before recalling to a mining location (less chance of loosing the beetle especially if you have hiding)
;---------- Mining Filter Setup ---------------
Set %BringUpMenuForFilters #true ; Brings up a selection menu for which colors to mine, and prospect
Set %UseProspector %NoColor ; Add (literally +) all the colors you want prospected !!! Spaces between everything are required !!!
Set %MineFor %AllColors ; Add (using +) all the colors you wish to mine (filters runebooks used)
; Color Variables:
; %AllColors, %NoColor, %Iron, %Dull, %Shadow, %Copper %Bronze, %Gold, %Agapite, %Verite, %Valorite, and %UnknownColor
; Examples:
; Set %UseProspector %UnknownColor + %Dull + %Bronze + %Agapite ; Prospect Dull Copper, Bronze, Agapite and any unlabelled runebooks
; Set %MineFor %AllColors ; Use all runebooks
; Set %MineFor %Bronze + %Gold ; Use Bronze and Gold runebooks ('Set %UseProspector %Bronze' and you only get Gold ore)
;---------- Mining Efficiency Variables ------------
; These variables are intended for people wanting to increase mining efficiency as much as possible.
; Choosing good mining locations (w/ multiple veins per rune) will yield easy improvements
Set %DumpIron #true ; #true results in large IRON ore to be dropped on exisint piles of ore within reach
; Note: I manually place large iron ore in a visible spot 2 squares from me (saw 12% improvement))
Set %NextRuneOnBaseUnload #true ; #true results in recalling to the next rune after Unloading to Bank/House [Suggested by Paton]
; This is displayed on the the status window (Keep track of your mining efficiency)
Set %TrackGPValue %ShowStatus ; Tracks how much gold (equivalent) you have mined based on the ore evaluation set below
;---------- Logging Variables ----------
; [REQUIRES: ALLOW EXECUTE and the file Save.js, saves to MiningSpots.txt]
Set %LogMiningResults #false ; Saves how many large color/iron ore is mined at each mining location
;------------- Siege Support -------------
Set %CastGate #false
; Set %UseGateScrolls #false ; Support in future versions
;---------- UOAssist Integration Setup ----------
; For these variables Key is the keystroke (A-Z, 0-9, F1 to F12) and the Mod comes from the list of EUO's Key function (Alt, Ctrl, Shift)
; *** NOTE *** This area was not tested, please report any problems *** NOTE ***
; Tinker Tool creation UOA macro (Should Use Item Type (tinker tools), Choose Tinker Tool, Close Tinker Menu)
Set %UOATinkerToolKey N/A
Set %UOATinkerToolMod N/A
Set %UOATinkerToolWait 10s
; Shovel creation UOA macro (Should Use Item Type (tinker tools), Choose Shovel, Close Tinker Menu)
Set %UOAShovelKey N/A
Set %UOAShovelMod N/A
Set %UOAShovelWait 10s
; Escape UOA macro key (If this is defined, the Escape button will press this key and then pause the script)
Set %UOAEscapeKey N/A
Set %UOAEscapeMod N/A
LinesPerCycle %lpsNormal
}
;********* User Defined Digging Locations Setup *******************************
Sub SetDigLocations
GoSub RunExternalDefinitions ; Do not change/remove this line
; You can define multiple mining spots (veins) per recall location (rune). Undefined mining locations will only work in a cave (it mines at your feet)
; There is a howto post on the thread for this script on how to set this up
GoSub FindRunebook XXXXXXX ; or %_RuneBook1 if you used the Interactive Setup and do not know the IDs
Set %sdlBook %return
if %sdlBook > 0
{
; SetUserDigCoord - *** Specify world coordinate mining locations ***
; Mine the location then use #LTargetX, #LTargetY, #LTargetZ, #LTargetKind #LTargetTile in EUO (Ctrl-R to View variables)
;
; GoSub SetUserDigCoord <RuneBook Index> <Rune Index 1-16> <#lTargetX> <#lTargetY> <#lTargetZ> <#lTargetKind> <#lTargetTile>
; Look at http://www.easyuo.com/forum/viewtopic.php?t=200 for tutorial on how to set these up
}
GoSub FindRunebook XXXXXXX ; or %_RuneBook2
Set %sdlBook %return
if %sdlBook > 0
{
; See above
}
Return
;*******************************************************
;******** DONT CHANGE ANYTHING PAST HERE
;*******************************************************
LinesPerCycle %lpsFast
Set %FixForUORecallBug #false ; I left this in here just in case the UO Bug hasn't been fixed
Set %HaveTargetted #false
Set %HaveProspected #false
Set %LastMadeWasShovel #false
Set %BackpackId null
Set %IsMounted #true
Set %UsingBeetle #true
Set %LastEnemyID #enemyID
Set %gNeedsCoordConv #false
Set #sCnt2 0
Set #sCnt 0
Set %_uowLastUse #scnt2
Set %TryHideAgain 0
Set %LogTimeUsage #false ; Log how much time major operations take and when they happen (Optimize the script, so internal use)
ChooseSkill tink
Set %TinkerSkill #skill
GoSub SetDigLocations
LinesPerCycle %lpsNormal
;*****************************************
;******** Start Up Code
;*****************************************
GoSub MineForMenu
Set %iRune 1
Set %iSpot 1
Set %iRuneBook 0
GoSub CheckInit
GoSub IncrementRuneBook
GoSub CreateStatusWindow
;*****************************************
;******** Main Loop
;*****************************************
GoSub RecordTimingComment Starting...
MainLoop:
GoSub RecallMine
CheckShovel:
GoSub FindShovel
If %return = Escape
{
GoSub Escape
Goto MainLoop
}
GoSub Digger
If %return = Escape
GoSub Escape
If %return = CheckShovel
goto CheckShovel
goto MainLoop
;*****************************************
;******** Tinkering
;*****************************************
; ** FindShovel **
; Tries to find a shovel, if non are found will initial
; tinkering or recall back to home base
Sub FindShovel
GoSub UpdateStatusWindow FindShovel
FindShovelStart:
GoSub CheckEscapeStatus
If %CheckEscapeStatus
Return
GoSub FindUsableMiningTool %BackpackId
If #FindId = X
{
if %UseTinkering
{
If %TinkerSkill >= 900
Set %_fsIngotsNeeded 10
Else
Set %_fsIngotsNeeded 20
FindItem %IngotType C_ , %BackpackId
If #FindKind = -1 || #FindStack < %_fsIngotsNeeded
GoSub UnloadAtBase #false
GoSub MakeShovel
Goto FindShovelStart
}
if ! %UseTinkering
{
GoSub UnloadAtBase #false
Goto FindShovelStart
}
}
Return
; ** MakeShovel **
; Will make 1-2 shovels using tinkering - Using the menus or
; UOA macros if they have been setup
Sub MakeShovel
GoSub CheckEscapeStatus
If %CheckEscapeStatus
Return
Set %_msTimeStart #sCnt2
GoSub UpdateStatusWindow MakeShovel
FindItem %TinkerType C_ , %BackpackId
Wait 5
If #FindKind <> -1 && #FindCnt = 1
{
If %UOATinkerToolKey <> N/A
{
Key %UOATinkerToolKey %UOATinkerToolMod
Wait %UOATinkerToolWait
}
If %UOATinkerToolKey = N/A
{
GoSub BringUpTinkerMenu #FindId
Wait 10
GoSub ClickTinkerButton 30 130
GoSub ClickTinkerButton 230 130
Set %LastMadeWasShovel #false
}
}
FindItem %TinkerType C_ , %BackpackId
If #FindKind <> -1
{
If %UOAShovelKey <> N/A
{
Key %UOAShovelKey %UOAShovelMod
Wait %UOAShovelWait
}
If %UOAShovelKey = N/A
{
GoSub BringUpTinkerMenu #FindId
If %LastMadeWasShovel ; If the last thing we made was a shovel, its easy!
GoSub ClickTinkerButton 285 450
If ! %LastMadeWasShovel
{
GoSub ClickTinkerButton 30 130
GoSub ClickTinkerButtonNext
GoSub ClickTinkerButton 230 70
}
Set %LastMadeWasShovel #true
If %MakeTwoShovels
GoSub ClickTinkerButton 285 450
}
Set %_msCancelX #ContPosX + 10
Set %_msCancelY #ContPosY + 10
Click %_msCancelX %_msCancelY R ; Close tinker menu
}
GoSub RecordTiming %_msTimeStart MakeShovel
Return
; ** ClickTinkerButton **
Sub ClickTinkerButton
Set %_ctbX %1 + #ContPosX
Set %_ctbY %2 + #ContPosY
Click %_ctbX %_ctbY
Wait 5
Return
; ** ClickTinkerButtonNoWait **
Sub ClickTinkerButtonNext
Set %_ctbnX 385 + #ContPosX
Set %_ctbnY 270 + #ContPosY
Click %_ctbnX %_ctbnY F
Wait 2s
Return
; ** BringUpTinkerMenu **
; Lag resistant opening of tinker menu
; Parameter 1: ID of tinker tool
Sub BringUpTinkerMenu
Set %_butmTinkerTool %1
Wait 5 ; A lot of times the tinker tool usage get 'You must wait...'
_butmTinkerMenu:
GoSub UseObject %_butmTinkerTool #false #false
Gosub waitForSysVar contSize = 530_437 30
Return
;*****************************************
;******** Digging routines
;*****************************************
; ** Digger **
; The main digging sub, this is called (at least) once per mining
; location. It will prospect, hide, mine, unload to pack, unload to base
; Returns: GotoNextLocation. StayAtLocation, CheckShovel
Sub Digger
_diggerStart:
Set %_diggerLastStrike #sCnt
Set %_diggerNoReponse #false
; Give the reds less time to react, as soon as we come in, check if they are around and hide before dismounting
GoSub CheckEscapeStatus
If %CheckEscapeStatus
Return
If ( ( %HideMineInFel && #cursKind = 0 ) || ( %HideMineElsewhere && #cursKind <> 0 ) ) && ( H notin #CharStatus ) && #scnt > %TryHideAgain
{
Event Macro 13 21
Set %TryHideAgain #scnt + 12
}
GoSub ShouldProspect
Set %_digShouldProspect %return
If ! %_digShouldProspect
GoSub DismountBeetle
_diggerLoop:
GoSub UpdateStatusWindow Digging
GoSub CheckEscapeStatus
If %CheckEscapeStatus
Return
If ( ( %HideMineInFel && #cursKind = 0 ) || ( %HideMineElsewhere && #cursKind <> 0 ) ) && ( H notin #CharStatus ) && #scnt > %TryHideAgain
{
Event Macro 13 21
Set %TryHideAgain #scnt + 12
}
If ! %HaveTargetted && %_digShouldProspect
GoSub MountBeetle
GoSub FindUsableMiningTool
GoSub UseObject #Result %HaveTargetted #true
Set %_digShovelUsed ( %return <> Blocked )
if %_digShovelUsed
{
GoSub TargetMiningLocation
If %return = Failed
{
Set %return CheckShovel
Return
}
}
LinesPerCycle %lpsFast
GoSub CheckEscapeStatus
If %CheckEscapeStatus
Return
GoSub CheckProgress
Set %CheckProgress %return
If %CheckProgress = Success
{
If %gNeedsCoordConv
GoSub RedefineDigSpot
Set %_diggerLastStrike #sCnt
Set %_diggerNoReponse #false
}
If %CheckProgress = MustWait
goto _diggerLoop
If %CheckProgress = Dismount
{
Set %_diggerNoReponse #false
GoSub DismountUnexpected
}
If %CheckProgress = NoResult
Set %_diggerNoReponse #true
If %CheckProgress = GotoNextLocation || %CheckProgress = CheckShovel
Return
If %CheckProgress = StayAtLocation
Goto _diggerStart
If ( %_diggerLastStrike + %GiveUpTime < #sCnt )
{
GoSub IncrementRuneIndex
Set #MenuButton N/A
If %return = GotoNextLocation
Return
If %return = StayAtLocation
Goto _diggerStart
}
LinesPerCycle %lpsNormal
If %_digShovelUsed && %_digShouldProspect && ! %HaveProspected
{
GoSub CheckEscapeStatus
If %CheckEscapeStatus
Return
GoSub UpdateStatusWindow Prospecting
FindItem %ProspType C_ , %BackpackId
If #FindKind <> -1
{
GoSub UseObject #FindId #false #false
GoSub TargetMiningLocation
GoSub DismountBeetle
}
Set %HaveProspected #true
}
goto _diggerLoop
return
Sub CountUsableMiningTool
Set %_cumtCount 0
_cumtLoop:
FindItem %DiggingTools C_ , %BackpackId
If #FindKind <> -1
{
GoSub IsUsableMiningTool
If #Result
Set %_cumtCount %_cumtCount + 1
IgnoreItem #FindId
goto _cumtLoop
}
IgnoreItem Reset
Return %_cumtCount
Sub FindUsableMiningTool
_fumtLoop:
FindItem %DiggingTools C_ , %BackpackId
If #FindKind <> -1
{
GoSub IsUsableMiningTool
If ! #Result
{
IgnoreItem #FindId
goto _fumtLoop
}
}
IgnoreItem Reset
Return #FindId
Sub IsUsableMiningTool
If #FindType notin %PickAxe || #FindCol <> 0
Return #true
GoSub EventProperty #FindId
Return ( Gargoyle notin #Property )
Sub EventProperty
Event Property %1
Set %_propTimeout #sCnt + 4
_propLoop:
If #Property = 0 && #sCnt < %_propTimeout
goto _propLoop
Return
; ** TargetMiningLocation **
; Gets the mining target for this location, waits for the target cursor
; and actually does the targetting
; Returns: Failed, Success
Sub TargetMiningLocation
target 2s
If #TargCurs = 0
{
Set %return Failed
Return
}
Set %isClickLoc #true
If ! %HaveTargetted
{
GoSub GetUserDigLocation %iRuneBook %iRune %iSpot
if %return = InCoords
Set %isClickLoc #false
if %return <> InCoords
Set %gNeedsCoordConv #true
}
_tmlTargetAgain:
If #TargCurs = 1
{
If %HaveTargetted
Event Macro 22 0
If ! %HaveTargetted
{
if %isClickLoc
Click %DigSpotX %DigSpotY d
if ! %isClickLoc
{
Set #LTargetX %DigSpotX
Set #LTargetY %DigSpotY
Set #LTargetZ %DigSpotZ
Set #LTargetKind %DigSpotKind
Set #LTargetTile %DigSpotTile
Event Macro 22 0
}
}
Goto _tmlTargetAgain
}
Set %HaveTargetted #true
Set %return Success
Return
;*****************************************
;******** Check mining progress
;*****************************************
; ** CheckProgress **
; Checks weight and initiates unload, mining failur attempts, and report whether
; mining is progressing
; Returns: Success, GotoNextLocation, StayAtLocation, Dismount, MustWait
Sub CheckProgress
Set %return Unknown
If #Weight > %MaxWeight
{
If %UsePackAnimal
GoSub UnloadToPackAnimal
If ! %UsePackAnimal
GoSub UnloadAtBase #false
}
for %_cpIndex 1 4
{
ScanJournal %_cpIndex
if #journal = N/A
Return
If ( you_dig_some in #journal ) || ( you_loosen_some_rocks in #journal )
{
Set %return Success
Goto _cpReturn
}
If ( There_is_no_metal_here_to_mine in #journal ) || ( that_is_too_far_away in #journal ) || ( you_can't_mine_that in #journal ) || ( you_can't_mine_there in #journal ) || ( you_cannot_see_that_location in #journal )
{
GoSub IncrementRuneIndex
Goto _cpReturn
}
If mine_while_riding in #journal
{
Set %return Dismount
Goto _cpReturn
}
If You_must_wait in #journal
{
Set %return MustWait7
Goto _cpReturn
}
If ( #Weight > %MaxWeight ) || ( Your_backpack_is_full in #journal )
{
Set %_cpReturnValue %return
If %UsePackAnimal
GoSub UnloadToPackAnimal
If ! %UsePackAnimal
GoSub UnloadAtBase #false
Set %_diggerLastStrike #sCnt
Goto _cpReturn
}
}
Return
_cpReturn:
deletejournal
Return
;*****************************************
;******** Enemy Detection and Evasion
;*****************************************
; ** Escape **
; Does its best attempt to recall away. If successful it will attempt
; to cure and heal before going to the next rune
Sub Escape
_escapeTryRecallAgain:
Set %_escapeLocationX #charPosX
Set %_escapeLocationY #charPosY
Set #MenuButton N/A
If %UOAEscapeKey = N/A
{
If %EscapeRecallTarget <> XXXXXXX
{
wait 30
GoSub RecallWithoutRunebook %EscapeRecallTarget
}
If %EscapeRecallTarget = XXXXXXX
GoSub Travel %BaseRunebook %BaseRune1 %TravelMethod #true
}
If %UOAEscapeKey <> N/A
Key %UOAEscapeKey %UOAEscapeMod
GoSub UpdateStatusWindow Escape
GoSub GetUserAttention Emergency
If %PauseAfterEscape
{
; Press [Play] when you are safe at your escape destination
pause
; Press [Play] when you are safe at your escape destination
}
Else
{
Set %_escapeRecallTimeout #sCnt + 10
_escapeCheckRecall:
If #sCnt > %_escapeRecallTimeout
{
GoSub CheckForConnDeath
Goto _escapeTryRecallAgain
}
If %_escapeLocationX = #charPosX && %_escapeLocationY = #charPosY
Goto _escapeCheckRecall
}
GoSub IncrementRuneIndex 1
Set %LastEnemyID #enemyID
If %UsePackAnimal
Msg All Follow Me$
Wait 1s ; Allow time for recall and character information to populate (#charStatus)
Set %_escapeCureAttempt 0
_escapeCheckPoison:
If %CureWithMagery && %_escapeCureAttempt < 7 && ( C in #charStatus )
{
If %TravelMethod = 0
event macro 15 201
Else
event Macro 15 10
Target 6s
event Macro 23 0
Wait 2s
Set %_escapeCureAttempt %_escapeCureAttempt + 1
Goto _escapeCheckPoison
}
If C in #charStatus
{
GoSub GetUserAttention Emergency
Display OK You must cure yourself to continue (Press Play After)
Pause
Goto _escapeCheckPoison
}
Set %_escapeHealAttempt 0
_escapeCheckHP:
If %GrHealAfterEscape && %_escapeHealAttempt < 7 && ( #hits < #MaxHits )
{
If %TravelMethod = 0
event Macro 15 202
Else
event Macro 15 28
Target 6s
event Macro 23 0
Wait 10
Set %_escapeHealAttempt %_escapeHealAttempt + 1
Goto _escapeCheckHP
}
If #hits < #MaxHits
{
GoSub GetUserAttention
Display OK You must heal yourself to full to continue (Press Play After)
Pause
Goto _escapeCheckHP
}
If ! %BankDrop
{
FindItem %SecureId G_2
If #FindKind <> -1
GoSub UnloadAtBase #true
}
Return
; ** CheckEscapeStatus **
; Looks if there are reasons for the script to escape. Reds, damage, pack animal moving
; Returns: Escape, N/A
Sub CheckEscapeStatus
Set %return N/A
If %ShowStatus && #MenuButton = Escape
{
Set %return Escape
Set %escapeReason User , #spc , Request
}
If %EscapeOnDamage && #Hits + %DamageThreshold < #MaxHits
{
Set %return Escape
Set %escapeReason Damage
}
If %RedEscape && %return = N/A && #cursKind = 0
{
_cesSearch:
FindItem NAB_OAB_HS_IS
If #FindKind <> -1
{
If #FindRep <> 6 || #FindId = #CharID || #FindId in #CharID
{
IgnoreItem #findId
Goto _cesSearch
}
If %RedCheckNPC
{
}
Set %return Escape
Set %escapeReason Red , #spc , Sighted
}
}
If %HighThreatMonster <> N/A
{
_cesSearch2:
FindItem %HighThreatMonster
If #FindKind <> -1
{
If #FindId = #CharID || #FindId in #CharID
{
IgnoreItem #findId
Goto _cesSearch2
}
Set %return Escape
Set %escapeReason Monster , #spc , Threat
}
}
If %TrackPackAnimal && %UsePackAnimal && %return = N/A && ! %IsMounted
{
FindItem %PackAnimalId
If #FindDist > 1
{
Set %return Escape
Set %escapeReason Packy , #spc , Left
Msg All Follow Me$
}
}
If %EscapeOnMonsterSighting && %LastEnemyID <> #enemyID
{
Set %LastEnemyID #enemyID
FindItem %LastEnemyID
if #FindType notin %NoThreatMonster
{
Set %return Escape
Set %escapeReason Monster , #spc , Target
}
}
Set %CheckEscapeStatus ( %return <> N/A )
If ! %CheckEscapeStatus && %ShowStatus && #MenuButton = PauseBut
{
GoSub HandlePauseButton
}
Return
;*****************************************
;******** UnloadAtBase
;*****************************************
; ** UnloadAtBase **
; Unloads ore at the house or bank, recalls to the location, opens up all the containers
; moves all the ore to the bag then picks up whatever is needed (ingots, shovels, prosp tools)
; Parameter 1: boolean Need to recall or not
Sub UnloadAtBase
Set %AlreadyAtBase %1
If ! %AlreadyAtBase
{
GoSub CheckEscapeStatus
If %CheckEscapeStatus
Return
If %MountBeforeRecall
GoSub MountBeetle
Set %_uabBaseRuneIndex ( #Random % %NumBaseRunes ) + 1
Set %_uabTimeStart #sCnt2
_uabStart:
GoSub Travel %BaseRunebook %BaseRune . %_uabBaseRuneIndex %TravelMethod #true
if %return = Blocked
{
Wait 6s
Set %_uabBaseRuneIndex %_uabBaseRuneIndex + 1
if %_uabBaseRuneIndex > %NumBaseRunes
Set %_uabBaseRuneIndex 1
Goto _uabStart
}
}
If %UsePackAnimal
{
GoSub DismountBeetle
Msg All Follow Me$
If ! %AlreadyAtBase
Wait 1s
}
If %StandLocationX <> 0
{
GoSub UpdateStatusWindow MoveToPosition
If %DoorID <> XXXXXXX
{
_uabRetryPFDoor:
GoSub PathFind %DoorUseX %DoorUseY %DoorUseZ 6
if ! %Return
goto _uabRetryPFDoor
GoSub UseObject %DoorID #false #false
}
_uabRetryPFSecure:
GoSub PathFind %StandLocationX %StandLocationY %StandLocationZ 6
If ! %Return
goto _uabRetryPFSecure
}
GoSub UpdateStatusWindow UnloadingToBase
GoSub UpdateMiningResults
GoSub OpenAnyContainer PaperDoll #CharID 534 1 5
GoSub OpenAnyContainer Backpack %BackpackId 650 335 5
If %BankDrop
{
GoSub OpenAnyContainer Bank N/A 27 49 5
Set %_uabSecureId #ContId
}
If %HideOnBaseUnload && H notin #CharStatus
Event Macro 13 21
If ! %BankDrop
{
FindItem %SecureId G
If #FindDist > 2
Move #findX #findy 2 5s
GoSub OpenAnyContainer Container %SecureId 27 49 5
Set %_uabSecureId %SecureId
}
FindItem %OreBagId
If #FindKind = -1
{
Display OK Cannot find Backpack in Bank Box/House Secure to drop off ore.$Is it missing or has it not been specified correctly (OreBagId).$$The script will now stop.
Halt
}
If %UsePackAnimal
{
GoSub OpenAnyContainer Container %PackAnimalBagId 40 480 5
;FindItem %PackAnimalDropId C_ , %PackAnimalBagId
;GoSub OpenAnyContainer Container #FindId 265 490 5
GoSub DragAnyItem %OreTypes #true %PackAnimalBagId All %OreBagId %TrackGPValue
GoSub DragAnyItem %GraniteType #true %PackAnimalBagId All %OreBagId #false
GoSub DragAnyItem %OreTypes #true %PackAnimalBagId All %OreBagId %TrackGPValue
}
GoSub DragAnyItem %OreTypes #true %BackpackId All %OreBagId %TrackGPValue
GoSub DragAnyItem %GraniteType #true %BackpackId All %OreBagId #false
If %UseProspector <> %NoColor
{
FindItem %ProspType C_ , %BackpackId
If #FindKind = -1
{
GoSub DragAnyItem %ProspType #true %_uabSecureId 1 #charid #false
If %return = NoneFound
{
Display YesNo Could not find any prospector's tools at the top of your bank/secure container.$$Would you like to continue without the use of a prospector's tool?
If #DispRes = No
Halt
Set %UseProspector %NoColor
}
}
}
if %UseTinkering
{
_uabMoreIngots:
FindItem %IngotType C_ , %BackpackId
If #FindKind = -1 || #FindStack < 40
{
GoSub DragAnyItem %IngotType %UseAnyColourIngot %_uabSecureId 60 %backpackid #false
If %return = NoneFound
{
Display YesNo Could not find any ingots at the top of your bank/secure container.$
+Without more you will not be able to continue mining (can't make shovels)$$
+Would you like to have 20 seconds to place some ingots at the top of your secure?
If #DispRes = No
Halt
Wait 20s
Goto _uabMoreIngots
}
}
}
_uabShovelLoop:
GoSub CountUsableMiningTool
If #Result < %MinShovels
{
GoSub DragAnyItem %DiggingTools #true %_uabSecureId 1 %BackpackId #false
If %return = NoneFound
{
If %UseTinkering
goto _uabBreakShovelLoop
Display YesNo Could not find any shovels at the top of your bank/secure container.$
+You won't be able to continue without more.$$
+Would you like to have 15 seconds to place shovels where script can find them?
If #DispRes = No
Halt
Wait 15s
}
Goto _uabShovelLoop
}
_uabBreakShovelLoop:
If ! %RegSuit
{
GoSub PickupReagent %MandrakeRoot Mandrake %_uabSecureId
GoSub PickupReagent %Bloodmoss Bloodmoss %_uabSecureId
GoSub PickupReagent %BlackPearl Black , #spc , Pearl %_uabSecureId
}
Event Macro 9 1 ; Close PaperDoll
GoSub SetStartOre #false
GoSub RecordTiming %_uabTimeStart UnloadToBase
If ! %AlreadyAtBase
{
If %NextRuneOnBaseUnload
GoSub IncrementRuneIndex 1
GoSub RecallMine
}
Return
; ** PickupReagent **
; A support function to remove duplicate code
; Parameter 1: ITEM_TYPE Type for Reagent
; Parameter 2: STRING Name of Reagent for user displayed dialog
; Parameter 3: ITEM_ID The container to look for reagents
Sub PickupReagent
Set %_prRegType %1
Set %_prRegName %2
Set %_prSecureId %3
FindItem %_prRegType C_ , %BackpackId
If #findkind = -1 || #findstack < 20
{
_prMoreIngots:
GoSub DragAnyItem %_prRegType #true %_prSecureId 30 %BackpackId #false
If %return = NoneFound
{
Display YesNo Could not find any , #spc , %_prRegName , #spc , at the top of your bank/secure container.$
+You won't be able to continue without more.$$
+Would you like to have 15 seconds to place some regs at the top of your secure?
If #DispRes = No
Halt
Wait 15s
Goto _prMoreIngots
}
}
Return
;*****************************************
;******** Pack Animal Routines
;*****************************************
; ** UnloadToPackAnimal **
; Unloads ore from the backpack to the pack animal (uses DragAnyItem to do the work)
Sub UnloadToPackAnimal
Set %_utpTimeStart #sCnt2
GoSub UpdateStatusWindow UnloadToPack
GoSub UpdateMiningResults
Set %_utpaUnload #false
_utpaStart:
FindItem %PackAnimalId
If #FindKind = -1
Set %_utpaUnload #true
If #FindKind <> -1
{
If #FindDist > 1
{
Msg All Follow Me$
Wait 1s
Goto _utpaStart
}
If %HideOnPackUnload && ( H notin #CharStatus ) && #scnt > %TryHideAgain
{
Event Macro 13 21
Set %TryHideAgain #scnt + 12
}
;FindItem %PackAnimalDropId C_ , %PackAnimalBagId
;If #FindKind = -1
;GoSub OpenAnyContainer Container %PackAnimalBagId 40 480 5
;FindItem %PackAnimalDropId C_ , %PackAnimalBagId
;If #FindKind = -1
;Display OK Could not find the drop bag inside the Pack Animal container$$Check PackAnimalBagId variable
GoSub DragAnyItem %OreTypes #true %BackpackId All %PackAnimalId #false
If %return = DestinationMissing
{
GoSub CheckEscapeStatus
If %CheckEscapeStatus
Return
}
If %return = ContainerFull
Set %_utpaUnload #true
GoSub DragAnyItem %GraniteType #true %BackpackId All %PackAnimalId #false
If %return = DestinationMissing
{
GoSub CheckEscapeStatus
If %CheckEscapeStatus
Return
}
If %return = ContainerFull
Set %_utpaUnload #true
}
GoSub SetStartOre #false
If ! %_utpaUnload
GoSub RecordTiming %_utpTimeStart UnloadToPack
If %_utpaUnload
{
GoSub RecordTiming %_utpTimeStart UnloadToPackPartial
GoSub UnloadAtBase #false
}
Return
; ** DismountUnexpected **
; This is called to dismount when the script thought you were already dismounted
Sub DismountUnexpected
GoSub UseObject #CharID #false #false
Set %IsMounted #false
Return
; ** DismountBeetle **
; Dismount from your beetle, the sub will check if you are even using beetles
; This moves the checking code to one place and removed 'if conditions' from places
; like the Digger sub. MountBeetle is the other side of this function
Sub DismountBeetle
If ! %UsePackAnimal || ! %UsingBeetle || ! %IsMounted
Return
FindItem %PackAnimalId G
If #FindKind = -1 || #FindBagId = #CharId
{
_dbLoop:
GoSub UseObject #CharID #false #false
Set %_dbTimeout #sCnt + 3
_dbWaitForBeetle:
if %_dbTimeout < #sCnt
Goto _dbLoop
FindItem %PackAnimalId
If #FindKind = -1
goto _dbWaitForBeetle
}
Set %IsMounted #false
Return
; ** MountBeetle **
; Mount from your beetle, the sub will check if you are even using beetles
; DismountBeetle is the other side of this function
Sub MountBeetle
If ! %UsePackAnimal || ! %UsingBeetle || %IsMounted
Return
_mbCallBeetle:
FindItem %PackAnimalId
If #FindKind <> 1
Return
If #FindDist > 1
{
Msg All Follow Me$
Wait 1s
}
Set %_mbCallTimeout #scnt + 4
_mbWaitForBeetle:
If %_mbCallTimeout < #scnt
Goto _mbCallBeetle
If #FindDist > 1
goto _mbWaitForBeetle
_mbMount:
GoSub UseObject %PackAnimalId #false #false
Wait 1s
FindItem %PackAnimalId
If #FINDKIND <> -1 && #FindBagId <> #CharID
Goto _mbMount
Set %IsMounted #true
Return
;*****************************************
;******** Runebook routines
;*****************************************
; ** RecallMine **
; Recall for the purposes of going to another mining location (not escaping), waits for mana
; and moves to the next rune if blocked
Sub RecallMine
If %MountBeforeRecall
GoSub MountBeetle
If %WaitForMana && #Mana < 32
{
GoSub UpdateStatusWindow WaitMana
_rmWaitMana:
GoSub CheckEscapeStatus
If %CheckEscapeStatus
Return
If %HideWhileManaWait && ( H notin #CharStatus ) && #scnt > %TryHideAgain
{
Event Macro 13 21
Set %TryHideAgain #scnt + 12
}
If #Mana < 32
goto _rmWaitMana
}
_rmTryAgain:
GoSub Travel %_RuneBook . %iRuneBook %iRune %TravelMethod #true
If %return = Blocked
{
GoSub IncrementRuneIndex 1
goto _rmTryAgain
}
GoSub SetStartOre #true
Return
; ** RecallWithoutRunebook **
; Recall by casting the spell and targetting a provided item
; Parameter 1: ITEM_ID Target for the recall (rune or runebook)
Sub RecallWithoutRunebook
Set %_rwrRuneTarget %1
_rwrCastRecall:
if %CastGate
Event Macro 15 51
Else
{
If %TravelMethod = 0
Event Macro 15 210
Else
Event Macro 15 31
}
Set #lTargetId %_rwrRuneTarget
Set #lTargetKind 1
Target 6s
If #TargCurs = 0
Goto _rwrCastRecall
Event Macro 22 0
if %CastGate
{
Set %_rwrGateTimeOut #sCnt + 6
_rwrLookForGate:
FindItem %GateType G_0
If #sCnt > %_rwrGateTimeOut
Goto _rwrCastRecall
If #FindKind = -1
Goto _rwrLookForGate
GoSub UseObject #FindID #false #false
}
Return
; ** Travel **
; Slightly reworked version of Recall sub from Standard subs, handles Gates as well as recall
; Parameter 1: ITEM_ID Runebook ID
; Parameter 2: Integer Rune index (1-16)
; Parameter 3: String Gate, SacredJourney, Recall
; Parameter 4: Boolean #true if called during mining, #flase when used through Location Definer (doesn't update status window)
Sub Travel
Set %_travelBookId %1
Set %_travelRune %2
If %3 = 0
Set %_travelType SacredJourney
Else
Set %_travelType Recall
Set %_travelStandard %4
Set %_travelLastMessage N/A
If %CastGate
Set %_travelType Gate
Set %_travelTimeStart #sCnt2
if %_travelStandard
GoSub UpdateStatusWindow Recall
Set %_pagex ( ( ( %_travelRune + 1 ) / 2 ) * 34 )
If ( ( %_travelRune + 1 ) / 2 ) > 4
Set %_pagex %_pagex + 31
_travelAgain:
Set %_travelOldX #CharPosx
Set %_travelOldY #CharPosy
_travelOpenAgain:
GoSub UseObject %_travelBookId #false #false
Gosub waitForSysVar contSize = 452_236 60
If ! %return
{
if %_travelStandard 2
Set %_travelLastMessage %_uswLastMessage
GoSub UpdateStatusWindow RecallBookError
Goto _travelOpenAgain
}
if %_travelLastMessage <> N/A
GoSub UpdateStatusWindow %_travelLastMessage
Wait 10
Set %_usePageX #ContPosX + 105 + %_pagex
Set %_usePageY #ContPosY + 200
Click %_usePageX %_usePageY F
Wait 5
deletejournal
Set %_usePageX #ContPosX + 140
If ( %_travelRune % 2 ) = 0
Set %_usePageX #ContPosX + 300
Set %_usePageY #ContPosY + 145
If %_travelType = Gate
Set %_usePageY %_usePageY + 20
If %_travelType = SacredJourney
Set %_usePageY %_usePageY + 40
Click %_usePageX %_usePageY F
Gosub waitForSysVar contSize <> 452_236 30
Set %_travelTimeout #sCnt + 10
_travelWaitForRecall:
If #SCNT > %_travelTimeout
{
If %FixForUORecallBug
{
Set %return Blocked ; This is a fix for the bug in UO, introduced in 4.0.0o
Return
}
goto _travelAgain
}
scanjournal 1
if something_is_blocking_the_location in #sysMsg
{
Set %return Blocked
Return
}
If for_this_spell in #journal
{
Event Macro 13 46
Wait 10s
goto _travelAgain
}
If %CastGate && You_open_a_magical in #journal
{
If %UsePackAnimal
Msg All Follow Me$
Set %_travelGateTimeOut #sCnt + 6
_travelLookForGate:
FindItem %GateType G_0
If #sCnt > %_travelGateTimeOut
Goto _travelAgain
If #FindKind = -1
Goto _travelLookForGate
GoSub UseObject #FindID #false #false
Wait 10
If #ContName = generic_gump && #ContSize = 420_280
{
Set %_usePageX #ContPosX + 25
Set %_usePageY #ContPosY + 261
Click 135 360
}
}
If %_travelOldX = #CharPosX && %_travelOldY = #CharPosY
goto _travelWaitForRecall
if %_travelStandard
GoSub RecordTiming %_travelTimeStart Recall
Set %return Success
return
;*****************************************
;****** Rune Index - Mining Spots
;*****************************************
; ** IncrementRuneIndex **
; Goes to the next mining location or the next rune if all mining locations for this spot are exhausted
; Parameter 1: Boolean Force to next rune (eg called after you escape so it won't recall back to danger)
Sub IncrementRuneIndex
Set %_iriParams %0
GoSub RecordMiningResults
LinesPerCycle %lpsFast
if %_iriTimeStart <> N/A
{
Set %_iriComment MiningOneSpot , #spc , %iRuneBook , #spc , %iRune , #spc , %iSpot
GoSub RecordTiming %_iriTimeStart %_iriComment
}
Set %_iriTimeStart #sCnt2
Set %HaveTargetted #false
Set %HaveProspected #false
If %_iriParams = 0
{
Set %_iriIndex ( ( %iRuneBook - 1 ) * 16 ) + %iRune
If %nDigSpots . %_iriIndex > %iSpot
{
Set %iSpot %iSpot + 1
Set %return StayAtLocation
LinesPerCycle %lpsNormal
Return
}
}
_iriTryNextRune:
Set %iSpot 1
Set %iRune %iRune + 1
If %iRune >= %_MaxRunes . %iRuneBook + 1
Set %iRune 1
If %iRune = 1
GoSub IncrementRuneBook
Set %_iriIndex ( ( %iRuneBook - 1 ) * 16 ) + %iRune
GoSub MakeUserDigVarName DigE %_iriIndex %iSpot
Set %_iriDangerTime % . %return
If #sCnt < %_iriDangerTime
goto _iriTryNextRune
Set %return GotoNextLocation
LinesPerCycle %lpsNormal
Return
Sub IncrementRuneBook
_irbFindRuneBookLoop:
Set %iRuneBook %iRuneBook + 1
If %iRuneBook >= %NumRuneBooks + 1
Set %iRuneBook 1
If ( %MineFor && ( %_Color . %iRuneBook ) ) = 0
goto _irbFindRuneBookLoop
Return
Sub AddRunebook
Set %_arId %1
Set %_arRuneCount %2
Set %_arColor %3
Set %_arExtFile %4
If %0 < 3
Set %_arColor %UnknownColor
If %0 < 4
Set %_arExtFile N/A
If %0 < 2 || %0 > 4
{
Display OK Invalid use of AddRunebook$(Gosub AddRunebook <Book_ID> <Rune_Count> [Color] [External_File])
Halt
}
If %numRuneBooks = N/A || %numRuneBooks < 1
Set %numRuneBooks 1
Else
Set %numRuneBooks %numRuneBooks + 1
Set %_RuneBook . %numRuneBooks %_arID
Set %_MaxRunes . %numRuneBooks %_arRuneCount
Set %_Color . %numRuneBooks %_arColor
Set %_ExtFile . %numRuneBooks %_arExtFile
If %_arExtFile <> N/A
Set %UsingExtFiles #true
Set %_arRuneMin ( ( %numRuneBooks - 1 ) * 16 ) + 1
Set %_arRuneMax ( ( %numRuneBooks - 1 ) * 16 ) + 16
For %_arRuneIndex %_arRuneMin %_arRuneMax
{
Set %nDigSpots . %_arRuneIndex 0
}
Return
Sub FindRunebook
for %_frbIndex 1 %numRuneBooks
{
if %1 = %_RuneBook . %_frbIndex
{
Set %return %_frbIndex
Return
}
}
Set %return 0
Return
Sub SetUserDigClickLoc
Set %_sudclRuneBook %1
Set %_sudclRune %2
Set %_sudclX %3
Set %_sudclY %4
Set %_sudclColor %5
Set %_sudclNumParams %0
If %_sudclNumParams < 5
Set %_sudclColor %_Color . %_sudclRuneBook
If %_sudclNumParams < 4 || %_sudclNumParams > 5
Display OK Invalid use of SetUserDigClickLoc
Set %_sudclIndex ( ( %_sudclRuneBook - 1 ) * 16 ) + %_sudclRune
If %nDigSpots . %_sudclIndex = N/A
Set %_sudclSpot 1
Else
Set %_sudclSpot %nDigSpots . %_sudclIndex + 1
Set %nDigSpots . %_sudclIndex %_sudclSpot
GoSub MakeUserDigVarName DigX %_sudclIndex %_sudclSpot
Set % . %return %_sudclX
GoSub MakeUserDigVarName DigY %_sudclIndex %_sudclSpot
Set % . %return %_sudclY
GoSub MakeUserDigVarName DigC %_sudclIndex %_sudclSpot
Set % . %return %_sudclColor
GoSub MakeUserDigVarName DigE %_sudclIndex %_sudclSpot
Set % . %return 0
GoSub MakeUserDigVarName DigXCoord %_sudclIndex %_sudclSpot
Set % . %return N/A
Return
Sub RemoveVein
Set %_rvRuneBook %1
Set %_rvRune %2
Set %_rvSpot %3
Set %_rvNumParams %0
If %_rvNumParams <> 3
Display OK Invalid use of RemoveVein
Set %_rvIndex ( ( %_rvRuneBook - 1 ) * 16 ) + %_rvRune
For %_rvSpotIndex %_rvSpot 4
{
if %_rvSpotIndex < 4
{
Set %_rvNextSpot %_rvSpotIndex + 1
GoSub GetUserDigLocation %_rvRuneBook %_rvRune %_rvNextSpot
GoSub DefineDigSpot %_rvIndex %_rvSpotIndex %DigSpotX %DigSpotY %DigSpotZ %DigSpotKind %DigSpotTile %DigSpotCol
}
}
Set %nDigSpots . %_rvIndex ( ( %nDigSpots . %_rvIndex ) - 1 )
Return
Sub SetUserDigCoord
Set %_sudcRuneBook %1
Set %_sudcRune %2
Set %_sudcX %3
Set %_sudcY %4
Set %_sudcZ %5
Set %_sudcK %6
Set %_sudcT %7
Set %_sudcColor %8
Set %_sudcNumParams %0
If %_sudcNumParams < 8
Set %_sudcColor %_Color . %_sudcRuneBook
If %_sudcNumParams < 7 || %_sudcNumParams > 8
Display OK Invalid use of SetUserDigCoord
Set %_sudcIndex ( ( %_sudcRuneBook - 1 ) * 16 ) + %_sudcRune
If %nDigSpots . %_sudcIndex = N/A
Set %_sudcSpot 1
Else
Set %_sudcSpot %nDigSpots . %_sudcIndex + 1
Set %nDigSpots . %_sudcIndex %_sudcSpot
GoSub DefineDigSpot %_sudcIndex %_sudcSpot %_sudcX %_sudcY %_sudcZ %_sudcK %_sudcT %_sudcColor
Return
Sub RedefineDigSpot
Set %_rssIndex ( ( %iRuneBook - 1 ) * 16 ) + %iRune
GoSub MakeUserDigVarName DigC %_sudclIndex %_sudclSpot
Set %_rssColor % . %return
GoSub DefineDigSpot %_rssIndex %iSpot #LTargetX #LTargetY #LTargetZ #LTargetKind #LTargetTile %_rssColor
Set %gNeedsCoordConv #false
Return
Sub DefineDigSpot
Set %_ddsIndex %1
Set %_ddsSpot %2
Set %_ddsX %3
Set %_ddsY %4
Set %_ddsZ %5
Set %_ddsK %6
Set %_ddsT %7
Set %_ddsColor %8
If %0 <> 8
Display OK Invalid use of DefineDigSpot (Spewy wrote a bug)
GoSub MakeUserDigVarName DigXCoord %_ddsIndex %_ddsSpot
Set % . %return %_ddsX
GoSub MakeUserDigVarName DigYCoord %_ddsIndex %_ddsSpot
Set % . %return %_ddsY
GoSub MakeUserDigVarName DigZCoord %_ddsIndex %_ddsSpot
Set % . %return %_ddsZ
GoSub MakeUserDigVarName DigKCoord %_ddsIndex %_ddsSpot
Set % . %return %_ddsK
GoSub MakeUserDigVarName DigTCoord %_ddsIndex %_ddsSpot
Set % . %return %_ddsT
GoSub MakeUserDigVarName DigCCoord %_ddsIndex %_ddsSpot
Set % . %return %_ddsColor
GoSub MakeUserDigVarName DigE %_ddsIndex %_ddsSpot
Set % . %return 0
Return
Sub GetUserDigLocation
Set %_gudlRunebook %1
Set %_gudlRune %2
Set %_gudlSpot %3
Set %_gudlIndex ( ( %_gudlRuneBook - 1 ) * 16 ) + %_gudlRune
GoSub MakeUserDigVarName DigXCoord %_gudlIndex %_gudlSpot
if % . %return <> N/A
{
Set %DigSpotX % . %return
GoSub MakeUserDigVarName DigYCoord %_gudlIndex %_gudlSpot
Set %DigSpotY % . %return
GoSub MakeUserDigVarName DigZCoord %_gudlIndex %_gudlSpot
Set %DigSpotZ % . %return
GoSub MakeUserDigVarName DigKCoord %_gudlIndex %_gudlSpot
Set %DigSpotKind % . %return
GoSub MakeUserDigVarName DigTCoord %_gudlIndex %_gudlSpot
Set %DigSpotTile % . %return
GoSub MakeUserDigVarName DigCCoord %_gudlIndex %_gudlSpot
Set %DigSpotCol % . %return
Set %return InCoords
Return
}
GoSub MakeUserDigVarName DigX %_gudlIndex %_gudlSpot
if % . %return <> N/A
{
Set %DigSpotX % . %return
GoSub MakeUserDigVarName DigY %_gudlIndex %_gudlSpot
Set %DigSpotY % . %return
Set %return InClick
Return
}
Set %DigSpotX #CharPosX
Set %DigSpotY #CharPosY
Set %DigSpotZ #CharPosZ
Set %DigSpotKind 2
Set %DigSpotTile 0
Set %return InCoords
Return
;*****************************************
;****** Timing Recording (for script optimization)
;*****************************************
Sub RecordTiming
If ! %LogTimeUsage
Return
Set %_rtStart %1
Set %_rtOp %2
Set %_rtTimeUsed #sCnt2 - %_rtStart
Set *1 #Date , #spc , #Time , #spc , %_rtOp , #spc , %_rtStart , #spc , #sCnt2 , #spc , %_rtTimeUsed
Execute Save.js MiningTimes.txt 1
Return
Sub RecordTimingComment
If ! %LogTimeUsage
Return
Set %_rtcComment %1
Set *1 #Date , #spc , #Time , #spc , %_rtcComment
Execute Save.js MiningTimes.txt 1
Return
Sub RecordMiningResults
If ! %LogMiningResults
return
GoSub UpdateMiningResults
if %MinedIronOre <> 0 || %MinedColorOre <> 0
{
If %LogMiningResults
{
Set %_rmrRunebookID ( %_Runebook . %iRuneBook )
Set %_rmrLeft #Date , #spc , #Time , #spc , " , #CharPosX , #spc , #CharPosY , #spc , %iSpot , " , #spc , %_rmrRunebookID , #spc , %iRune
Set *1 %_rmrLeft , #spc , %MinedIronOre , #spc , %MinedColorOre , #spc , %MinedOreColor
Execute Save.js MiningSpots.txt 1
}
}
GoSub SetStartOre #true
Return
Sub UpdateMiningResults
If ! %LogMiningResults
return
_umrOreLoop:
FindItem %LargeOreType C_ , %BackpackId
If #FindKind <> -1
{
Set %_umrStartValue %StartOre . #FindCol
If %_umrStartValue < #FindStack
{
If #FindCol = 0
Set %MinedIronOre %MinedIronOre + ( #FindStack - %_umrStartValue )
If #FindCol <> 0
{
Set %MinedOreColor %ColRGBNames . #FindCol
Set %MinedColorOre %MinedColorOre + ( #FindStack - %_umrStartValue )
}
}
IgnoreItem #FindId
Goto _umrOreLoop
}
IgnoreItem Reset
GoSub SetStartOre #false
Return
Sub SetStartOre
If ! %LogMiningResults
return
Set %_ssoReset %1
If %0 <> 1
Display OK Invalid use of SetStartOre (Spewy wrote a bug)
GoSub SetVarByColor StartOre %Iron 0
GoSub SetVarByColor StartOre %Dull 0
GoSub SetVarByColor StartOre %Shadow 0
GoSub SetVarByColor StartOre %Copper 0
GoSub SetVarByColor StartOre %Bronze 0
GoSub SetVarByColor StartOre %Gold 0
GoSub SetVarByColor StartOre %Agapite 0
GoSub SetVarByColor StartOre %Verite 0
GoSub SetVarByColor StartOre %Valorite 0
_ssoOreLoop:
FindItem %LargeOreType C_ , %BackpackId
If #FindKind <> -1
{
Set %StartOre . #FindCol #FindStack
IgnoreItem #FindId
Goto _ssoOreLoop
}
IgnoreItem Reset
If %_ssoReset
{
Set %MinedIronOre 0
Set %MinedColorOre 0
Set %MinedOreColor Iron
}
Return
Sub SetVarByColor
Set %_svbcVarPrefix %1
Set %_svbcOreColor %2
Set %_svbcValue %3
Set %_svbcIndex ( %Colors . %_svbcOreColor )
Set %_svbcVarName %_svbcVarPrefix , %_svbcIndex
Set % . %_svbcVarName %_svbcValue
Return
Sub ClearDigLocations
Set %UsingExtFiles #false
Set %NumRuneBooks 0
Return
Sub RunExternalDefinitions
If ! %UsingExtFiles
Return
Set %_redExtFileCount 0
For %_redIndex 1 %NumRuneBooks
{
If ( %MineFor && ( %_Color . %_redIndex ) ) <> 0
{
Set %_redExtFileCalled #false
Set %_redCurFile %_ExtFile . %_redIndex
If %_redExtFileCount > 0
{
For %_redExtIndex 1 %_redExtFileCount
{
If %_redExtFiles . %_redExtIndex = %_redCurFile
{
Set %_redExtFileCalled #true
Set %_redExtIndex %_redExtFileCount + 1
}
}
}
If ! %_redExtFileCalled
{
Call %_redCurFile
Set %_redExtFileCount %_redExtFileCount + 1
Set %_redExtFiles . %_redExtFileCount %_redCurFile
}
}
}
Return
Sub ShouldProspect
Set %return #false
If ( %UseProspector && ( %_Color . %iRuneBook ) ) <> 0
Set %return #true
Return
Sub MakeUserDigVarName
set %_mudvnVarName %1 , %2
set %_mudvnVarName %_mudvnVarName , S
Set %return %_mudvnVarName , %3
Return
;*****************************************
;****** GUIDED SETUP
;*****************************************
Sub InteractiveDefaults
LinesPerCycle %lpsFast
GoSub SetVariableDefaults
GoSub RetrieveInteractiveValues
LinesPerCycle %lpsNormal
If %return = Success
{
Display YesNoCancel Would you like to use the settings you specified earlier?$$
+(Didn't use the Interactive setup? Press [Cancel] and set UseInteractiveSetup to false)
If #DispRes = Cancel
Halt
If #DispRes = Yes
Return
}
If %return <> Success
{
Display OKCancel You will need to be near the bank or house secure, with$
+your pack animal with a backpack inside it (if you want to use one)$
+along with tinker tools and some ingots.$$Are you ready to continue?
If #DispRes = Cancel
Halt
}
event Macro 9 7
wait 5
_idCharBackpack:
Set #NEXTCPOSX 650
Set #NEXTCPOSY 335
Set %idOldContId #ContId
GoSub UseObjectEvent 8 7
Gosub waitForSysVar ContId <> %idOldContId 60
If ! %return || #ContId = N/A
goto _idCharBackpack
Set %BackpackId #ContId
_idOptionsRestart:
GoSub CreateMainSetupMenu
Set #MenuButton N/A
_idOptionsLoop:
If #MenuButton = N/A
goto _idOptionsLoop
; Update the values coming from edit controls (They can be lost if we go into other dialogs)
menu GetNum MaxWeight 0
Set %MaxWeight #MenuRes
Set %NumBaseRunes 0
For %_idOptionsLoopIndex 1 4
{
Set %BaseRune . %_idOptionsLoopIndex 0
Set %_idOptionsTemp RuneIndex , %_idOptionsLoopIndex
menu GetNum %_idOptionsTemp 0
if #MenuRes >= 1 && #MenuRes <= 16
{
Set %NumBaseRunes %NumBaseRunes + 1
Set %BaseRune . %NumBaseRunes #MenuRes
}
}
if %NumBaseRunes = 0
{
Set %NumBaseRunes 1
Set %BaseRune1 1
}
If #MenuButton = RegYes || #MenuButton = RegNo 2
Set %RegSuit ( #MenuButton = RegYes )
GoSub CreateYesNoButtons Reg 5 %RegSuit
If #MenuButton = PackYes || #MenuButton = PackNo
{
Set %UsePackAnimal ( #MenuButton = PackYes )
GoSub HandlePackButtons %UsePackAnimal
GoSub CreateYesNoButtons Pack 55 %UsePackAnimal
}
If #MenuButton = BankYes || #MenuButton = BankNo 2
Set %BankDrop ( #MenuButton = BankYes )
GoSub CreateYesNoButtons Bank 80 %BankDrop
If #MenuButton = HideFYes || #MenuButton = HideFNo 2
Set %HideMineInFel ( #MenuButton = HideFYes )
GoSub CreateYesNoButtons HideF 230 %HideMineInFel
If #MenuButton = HideEYes || #MenuButton = HideENo 2
Set %HideMineElsewhere ( #MenuButton = HideEYes )
GoSub CreateYesNoButtons HideE 255 %HideMineElsewhere
If #MenuButton = HideMYes || #MenuButton = HideMNo 2
Set %HideWhileManaWait ( #MenuButton = HideMYes )
GoSub CreateYesNoButtons HideM 280 %HideWhileManaWait
If #MenuButton = HidePYes || #MenuButton = HidePNo 2
Set %HideOnPackUnload ( #MenuButton = HidePYes )
GoSub CreateYesNoButtons HideP 305 %HideOnPackUnload
If #MenuButton = HideBYes || #MenuButton = HideBNo 2
Set %HideOnBaseUnload ( #MenuButton = HideBYes )
GoSub CreateYesNoButtons HideB 330 %HideOnBaseUnload
If #MenuButton = DumpYes || #MenuButton = DumpNo 2
Set %DumpIron ( #MenuButton = DumpYes )
GoSub CreateYesNoButtons Dump 130 %DumpIron
If #MenuButton = StatusYes || #MenuButton = StatusNo 2
Set %ShowStatus ( #MenuButton = StatusYes )
GoSub CreateYesNoButtons Status 155 %ShowStatus
If #MenuButton = TwoShovelsYes || #MenuButton = TwoShovelsNo 2
Set %MakeTwoShovels ( #MenuButton = TwoShovelsYes )
GoSub CreateYesNoButtons TwoShovels 180 %MakeTwoShovels
If #MenuButton = TinkerYes || #MenuButton = TinkerNo 2
Set %UseTinkering ( #MenuButton = TinkerYes )
GoSub CreateYesNoButtons Tinker 105 %UseTinkering
If #MenuButton = GateYes || #MenuButton = GateNo 2
Set %CastGate ( #MenuButton = GateYes )
GoSub CreateYesNoButtons Gate 30 %CastGate
If #MenuButton = NextRuneYes || #MenuButton = NextRuneNo 2
Set %NextRuneOnBaseUnload ( #MenuButton = NextRuneYes )
GoSub CreateYesNoButtons NextRune 205 %NextRuneOnBaseUnload
If #MenuButton = ColIngotYes || #MenuButton = ColIngotNo 2
Set %UseAnyColourIngot ( #MenuButton = ColIngotYes )
GoSub CreateYesNoButtons ColIngot 355 %UseAnyColourIngot
If #MenuButton = TravelMethodYes || #MenuButton = TravelMethodNo 2
Set %TravelMethod ( #MenuButton = TravelMethodYes )
GoSub CreateYesNoButtons TravelMethod 380 %TravelMethod
If #MenuButton = HouseRunebook
{
Menu Hide
_idHouseRuneBook:
Display OKCancel DOUBLE CLICK$$RUNEBOOK with BANK/HOUSE rune in your character's MAIN BACKPACK
If #DispRes = Cancel
Goto _idOptionsCancelRestore
Set #lObjectID null
GoSub waitForSysVar lObjectID <> null 60
If ! %return
goto _idHouseRuneBook
Set %BaseRunebook #lObjectID
Menu Show
Set #MenuButton N/A
}
If #MenuButton = PackSetupBT
{
Menu Hide
FindItem %PackAnimals
if #FindKind = -1
{
Display OkCancel Stand next to your pack animal (Or dismount beetle)
If #DispRes = Cancel
Goto _idOptionsCancelRestore
}
_idPackAnimal:
FindItem %PackAnimals
if #FindKind = -1
{
If %_idPackAnimalTimeOut > #scnt
{
Display OkCancel Stand next to your pack animal (Or dismount beetle)
If #DispRes = Cancel
Goto _idOptionsCancelRestore
Set %_idPackAnimalTimeOut #scnt + 3
}
goto _idPackAnimal
}
Set %PackAnimalId #FindID
Set %UsingBeetle ( #FindType = %BeetleType )
_idPackAnimalBag:
If #ContSize = 230_204
{
Event Macro 31 0 ; Close Everything
wait 2s
}
Display OkCancel OPEN the PACK ANIMAL container (Leave container open)
If #DispRes = Cancel
Goto _idOptionsCancelRestore
GoSub waitForSysVar2 ContID <> #ContID ContSize = 230_204 60
If ! %return
goto _idPackAnimalBag
Set %PackAnimalBagId #ContId
;FindItem %BagTypes C_ , %PackAnimalBagId
;If #FindKind <> -1
;Set %PackAnimalDropId #FindId
;If #FindKind = -1
;{
; _idPackAnimalOreBag:
; Display OKCancel PLACE A BAG in the pack animal and DOUBLE CLICK it (Ore Bag)
; If #DispRes = Cancel
; Goto _idOptionsCancelRestore
; Set #lObjectID null
; GoSub waitForSysVar lObjectID <> null 100
; If ! %return
; goto _idPackAnimalOreBag
; Set %PackAnimalDropId #lObjectId
;}
Menu Show
Set #MenuButton N/A
}
If #MenuButton = EscapeSetupBT
{
GoSub EscapeSetup
GoSub CreateMainSetupMenu
Menu Show
Set #MenuButton N/A
}
If #MenuButton = SecureBT
{
Menu Hide
If ! %BankDrop
{
_idSecureContainer:
Display OKCancel DOUBLE CLICK$$House Secure Container (Leave container open)
If #DispRes = Cancel
Goto _idOptionsCancelRestore
Set #lObjectID null
GoSub waitForSysVar lObjectID <> null 60
If ! %return
goto _idSecureContainer
Set %SecureId #lObjectId
}
If %BankDrop
{
_idSecureContainer:
Display OKCancel Open your BANK BOX (Leave container open)
If #DispRes = Cancel
Goto _idOptionsCancelRestore[/spoile
Kod:
;*****************************************
;******** Tinkering
;*****************************************
; ** FindShovel **
; Tries to find a shovel, if non are found will initial
; tinkering or recall back to home base
Sub FindShovel
GoSub UpdateStatusWindow FindShovel
FindShovelStart:
GoSub CheckEscapeStatus
If %CheckEscapeStatus
Return
GoSub FindUsableMiningTool %BackpackId
If #FindId = X
{
if %UseTinkering
{
If %TinkerSkill >= 900
Set %_fsIngotsNeeded 10
Else
Set %_fsIngotsNeeded 20
FindItem %IngotType C_ , %BackpackId
If #FindKind = -1 || #FindStack < %_fsIngotsNeeded
GoSub UnloadAtBase #false
GoSub MakeShovel
Goto FindShovelStart
}
if ! %UseTinkering
{
GoSub UnloadAtBase #false
Goto FindShovelStart
}
}
Return
; ** MakeShovel **
; Will make 1-2 shovels using tinkering - Using the menus or
; UOA macros if they have been setup
Sub MakeShovel
GoSub CheckEscapeStatus
If %CheckEscapeStatus
Return
Set %_msTimeStart #sCnt2
GoSub UpdateStatusWindow MakeShovel
FindItem %TinkerType C_ , %BackpackId
Wait 5
If #FindKind <> -1 && #FindCnt = 1
{
If %UOATinkerToolKey <> N/A
{
Key %UOATinkerToolKey %UOATinkerToolMod
Wait %UOATinkerToolWait
}
If %UOATinkerToolKey = N/A
{
GoSub BringUpTinkerMenu #FindId
Wait 10
GoSub ClickTinkerButton 25 110
GoSub ClickTinkerButton 374 222
GoSub ClickTinkerButton 223 71
Set %LastMadeWasShovel #false
}
}
FindItem %TinkerType C_ , %BackpackId
If #FindKind <> -1
{
If %UOAShovelKey <> N/A
{
Key %UOAShovelKey %UOAShovelMod
Wait %UOAShovelWait
}
If %UOAShovelKey = N/A
{
GoSub BringUpTinkerMenu #FindId
If %LastMadeWasShovel ; If the last thing we made was a shovel, its easy!
GoSub ClickTinkerButton 276 413
If ! %LastMadeWasShovel
{
GoSub ClickTinkerButton 25 110
GoSub ClickTinkerButtonNext
GoSub ClickTinkerButton 230 70
}
Set %LastMadeWasShovel #true
If %MakeTwoShovels
GoSub ClickTinkerButton 275 415
}
Set %_msCancelX #ContPosX + 10
Set %_msCancelY #ContPosY + 10
Click %_msCancelX %_msCancelY R ; Close tinker menu
}
GoSub RecordTiming %_msTimeStart MakeShovel
Return
; ** ClickTinkerButton **
Sub ClickTinkerButton
Set %_ctbX %1 + #ContPosX
Set %_ctbY %2 + #ContPosY
Click %_ctbX %_ctbY
Wait 5
Return
; ** ClickTinkerButtonNoWait **
Sub ClickTinkerButtonNext
Set %_ctbnX 385 + #ContPosX
Set %_ctbnY 270 + #ContPosY
Click %_ctbnX %_ctbnY F
Wait 2s
Return
; ** BringUpTinkerMenu **
; Lag resistant opening of tinker menu
; Parameter 1: ID of tinker tool
Sub BringUpTinkerMenu
Set %_butmTinkerTool %1
Wait 5 ; A lot of times the tinker tool usage get 'You must wait...'
_butmTinkerMenu:
GoSub UseObject %_butmTinkerTool #false #false
Gosub waitForSysVar contSize = 530_437 30
Return
;******** Tinkering
;*****************************************
; ** FindShovel **
; Tries to find a shovel, if non are found will initial
; tinkering or recall back to home base
Sub FindShovel
GoSub UpdateStatusWindow FindShovel
FindShovelStart:
GoSub CheckEscapeStatus
If %CheckEscapeStatus
Return
GoSub FindUsableMiningTool %BackpackId
If #FindId = X
{
if %UseTinkering
{
If %TinkerSkill >= 900
Set %_fsIngotsNeeded 10
Else
Set %_fsIngotsNeeded 20
FindItem %IngotType C_ , %BackpackId
If #FindKind = -1 || #FindStack < %_fsIngotsNeeded
GoSub UnloadAtBase #false
GoSub MakeShovel
Goto FindShovelStart
}
if ! %UseTinkering
{
GoSub UnloadAtBase #false
Goto FindShovelStart
}
}
Return
; ** MakeShovel **
; Will make 1-2 shovels using tinkering - Using the menus or
; UOA macros if they have been setup
Sub MakeShovel
GoSub CheckEscapeStatus
If %CheckEscapeStatus
Return
Set %_msTimeStart #sCnt2
GoSub UpdateStatusWindow MakeShovel
FindItem %TinkerType C_ , %BackpackId
Wait 5
If #FindKind <> -1 && #FindCnt = 1
{
If %UOATinkerToolKey <> N/A
{
Key %UOATinkerToolKey %UOATinkerToolMod
Wait %UOATinkerToolWait
}
If %UOATinkerToolKey = N/A
{
GoSub BringUpTinkerMenu #FindId
Wait 10
GoSub ClickTinkerButton 25 110
GoSub ClickTinkerButton 374 222
GoSub ClickTinkerButton 223 71
Set %LastMadeWasShovel #false
}
}
FindItem %TinkerType C_ , %BackpackId
If #FindKind <> -1
{
If %UOAShovelKey <> N/A
{
Key %UOAShovelKey %UOAShovelMod
Wait %UOAShovelWait
}
If %UOAShovelKey = N/A
{
GoSub BringUpTinkerMenu #FindId
If %LastMadeWasShovel ; If the last thing we made was a shovel, its easy!
GoSub ClickTinkerButton 276 413
If ! %LastMadeWasShovel
{
GoSub ClickTinkerButton 25 110
GoSub ClickTinkerButtonNext
GoSub ClickTinkerButton 230 70
}
Set %LastMadeWasShovel #true
If %MakeTwoShovels
GoSub ClickTinkerButton 275 415
}
Set %_msCancelX #ContPosX + 10
Set %_msCancelY #ContPosY + 10
Click %_msCancelX %_msCancelY R ; Close tinker menu
}
GoSub RecordTiming %_msTimeStart MakeShovel
Return
; ** ClickTinkerButton **
Sub ClickTinkerButton
Set %_ctbX %1 + #ContPosX
Set %_ctbY %2 + #ContPosY
Click %_ctbX %_ctbY
Wait 5
Return
; ** ClickTinkerButtonNoWait **
Sub ClickTinkerButtonNext
Set %_ctbnX 385 + #ContPosX
Set %_ctbnY 270 + #ContPosY
Click %_ctbnX %_ctbnY F
Wait 2s
Return
; ** BringUpTinkerMenu **
; Lag resistant opening of tinker menu
; Parameter 1: ID of tinker tool
Sub BringUpTinkerMenu
Set %_butmTinkerTool %1
Wait 5 ; A lot of times the tinker tool usage get 'You must wait...'
_butmTinkerMenu:
GoSub UseObject %_butmTinkerTool #false #false
Gosub waitForSysVar contSize = 530_437 30
Return
tinkering kısmını bir de böyle dener misiin
Bu mesaja teşekkür edenler (1 kişi): kadir1404
Sayfaya git: 1, 2, Sonraki | |
1. sayfa (Toplam 2 sayfa) [ 15 mesaj ] |
Bu forumda yeni başlıklar açamazsınız Bu forumdaki başlıklara cevap veremezsiniz Bu forumdaki mesajlarınızı değiştiremezsiniz Bu forumdaki mesajlarınızı silemezsiniz Bu forumdaki anketlerde oy kullanamazsınız |
World of UO - Age of Shadows Sunucusu © 2003 - 2020