The Wiki for Tale 4 is in read-only mode and is available for archival and reference purposes only. Please visit the current Tale 11 Wiki in the meantime.
If you have any issues with this Wiki, please post in #wiki-editing on Discord or contact Brad in-game.
User:Obol/Macros/Tin
From A Tale in the Desert
Jump to navigationJump to searchTin (does not need the ObolObjects file)
- Make sure the path in CheckforLostFocus has the right path
// ATITD Tin Ore Mining Macro for ACTool // RELEASE: Jan-9-2009 // Original Mining Script by Coyan // Adapted for Tin by Xyrrus // // SETUP // // First align your view so you can see all 7 crystals clearly // second use Alt-L to lock your camera angle // // You will have 3 seconds between the recording of each crystal's location // place your mouse over a spot of average gem color for each crystal in turn // Once it has identified the 7 crystals, it will run the mine // // ** FOR TIN ** Place your cursor over the **DARKEST PART* of each particular gem or you will experience higher failure rates. // This is often the base/corner of the crystal. // // Method: // Script mines the gem with the lowest blue component value. // // Accuracy: // Tested 50 pulls, 3 errors. - Xyrrus Jan-9-2009 // Incidently, this is better than many players report by hand. Constructs MouseX=List // this is an array of mouse X coords for gem sample points MouseY=List // this is an array of mouse X coords for gem sample points CrysBlue=List OEOffset=List END Constants OELevel = 4 // ** SET THIS ** to the 'depth' you want the memory game to play. A higher number will mean that you will achieve higher quantities per pull. However, a failure means that the sequence is reset and you will get "failed" messages equal to this number. Set this higher if you're very confident in your ability to place the cursor on the darkest part of each gem. Set it lower if you're less accurate. 3 is a good starting number. If you consistently see low-error performance, set it higher. Note that this number *for tin ore* does not appear to rely on ore extraction skill level (?) totalpulls = 1000 // How many times do you want it to pull the mine. delayTime = 1700 //colordiff = 10 // this is used to find a base for comparison, shouldn't need adjusting //CDiff = 0 RepairAdjust = 0 // ** SET THIS ** to adjust the vertical positining of the mouse if the mine is not being worked. Increase / decrease by 15 per line as needed. "This mine has been repaired" text and custom mine labels will result in adjustments being required: // 15 - No Repairs or Text // 0 - Repair or Text Compare = 0 Currcrys = 0 LowestCrystal = 0 CurrentLow = 0 //DIFFFOUND = 0 //Minval = 0 //Maxval = 0 Tmpval = 0 loopcnt = 1 Mousecnt = 1 MouseXN = 0 MouseYN = 0 //ColorHS = 0 OElistcnt = 0 OELvlset = 1 CurrCrysBlue = 0 startX = 0 startY = 0 End SetConst startX = {MouseX} SetConst startY = {MouseY} MousePos 45, 35 Delay 200 RightClick Delay 20 MousePos $startX, $startY Compute LowestCrystal = 0 Compute CurrentLow = 255 // First part that requires a detailed explanation // this loop will pause for 3 seconds then grab the current mouse location // its purpose is to identify the 7 sampling locations for the crystals // when it grabs the sampling spot, it will then echo a . to the chat window // make sure you are in your main chat tab. Loop 7 Delay 3000 Listadd MouseX, {MouseX} Listadd MouseY, {MouseY} SayPaste . If $CheckforLostFocus = 1 stop End END ListClear OEOffset loop $totalpulls Compute loopcnt = 1 ListClear CrysBlue loop 7 mousepos MouseX[$loopcnt], MouseY[$loopcnt] LoadRGB MouseX[$loopcnt], MouseY[$loopcnt] // Setup the List Call GetBlueValues Compute loopcnt = $loopcnt + 1 Delay 100 END //Delay 100000 for testing CALL FindTinOre CALL OreExtractionstore ListCount OEOffset, $OElistcnt IF $OELevel >= $OElistcnt Compute OELvlset = OEOffset[1] // work the current crystal until we are at our OE Level ELSE Compute OELvlset = OEOffset[$OELevel] END //Saypaste $OELevel $OElistcnt $OELvlset mousepos MouseX[$OELvlset], MouseY[$OELvlset] Delay 200 //200 leftclick Compute MouseXN = MouseX[$OELvlset] + 15 // adjust this if you need to for the menu click Compute MouseYN = MouseY[$OELvlset] - $repairadjust // adjust this if you need to for the menu click Mousepos $MouseXN, $MouseYN Delay 200 Leftclick IsObject UhOH at 370, 341 Call DoDialogs Delay $delayTime // Delay to manage the str/perc timer on mining, adjust as needed Else Compute $delayTime = $delayTime - 10 End IsObject Zapped at 383, 343 Call DoDialogs Delay $delayTime // Delay to manage the str/perc timer on mining, adjust as needed Else Compute $delayTime = $delayTime - 10 End Delay $delayTime // Delay to manage the str/perc timer on mining, adjust as needed If $CheckforLostFocus = 1 Stop End end Procedure DoDialogs Compute $delayTime = $delayTime + 500 Delay $delayTime // ok button MousePos 508, 476 Delay 50 Rightclick Delay 50 mousepos MouseX[$OELvlset], MouseY[$OELvlset] Delay 200 //200 leftclick Compute MouseXN = MouseX[$OELvlset] + 15 // adjust this if you need to for the menu click Compute MouseYN = MouseY[$OELvlset] - 5 // adjust this if you need to for the menu click Mousepos $MouseXN, $MouseYN Delay 200 Leftclick Delay $delayTime End Procedure GetBlueValues // Find the 'blueness' of each crystal, add it to the list. The gem with tin is the gem with the lowest blue component. Compute CurrCrysBlue = {RGBBlue} Listadd CrysBlue, $CurrCrysBlue END Procedure FindTinOre // Find which element in the list has the least amount of blue in it. Compute LowestCrystal = 0 Compute CurrentLow = 255 Compute Currcrys = 1 loop 7 If CrysBlue[$CurrCrys] < $CurrentLow compute lowestCrystal = $currCrys compute currentLow = crysblue[$currcrys] END Compute Currcrys = $Currcrys + 1 END //loop Compute Mousecnt = $LowestCrystal END Procedure OreExtractionstore // Memory game storage ListCount OEOffset, $OElistcnt IF $OElistcnt = 0 Listadd OEOffset, $Mousecnt ELSE IF $OElistcnt = 1 Listadd OEOffset, OEOffset[1] END IF $OElistcnt = 2 Listadd OEOffset, OEOffset[2] Compute OEOffset[2] = OEOffset[1] END IF $OElistcnt = 3 Listadd OEOffset, OEOffset[3] Compute OEOffset[3] = OEOffset[2] Compute OEOffset[2] = OEOffset[1] END IF $OElistcnt = 4 Listadd OEOffset, OEOffset[4] Compute OEOffset[4] = OEOffset[3] Compute OEOffset[3] = OEOffset[2] Compute OEOffset[2] = OEOffset[1] END IF $OElistcnt = 5 Listadd OEOffset, OEOffset[5] Compute OEOffset[5] = OEOffset[4] Compute OEOffset[4] = OEOffset[3] Compute OEOffset[3] = OEOffset[2] Compute OEOffset[2] = OEOffset[1] END IF $OElistcnt = 6 Listadd OEOffset, OEOffset[6] Compute OEOffset[6] = OEOffset[5] Compute OEOffset[5] = OEOffset[4] Compute OEOffset[4] = OEOffset[3] Compute OEOffset[3] = OEOffset[2] Compute OEOffset[2] = OEOffset[1] END IF $OElistcnt = 7 Compute OEOffset[7] = OEOffset[6] Compute OEOffset[6] = OEOffset[5] Compute OEOffset[5] = OEOffset[4] Compute OEOffset[4] = OEOffset[3] Compute OEOffset[3] = OEOffset[2] Compute OEOffset[2] = OEOffset[1] END Compute OEOffset[1] = $Mousecnt END END Function CheckforLostFocus if {activewindow} contains AC Tool 5.4.0 - C:\Marcos\Mining_Tin.mac Compute Result = 1 Exit Else Compute Result = 0 Exit End End Object UhOH // Test at coords 370, 341 222=0,0|223=2,0|211=4,0|219=6,0|225=8,0|227=10,0|220=12,0|223=14,0|232=16,0|232=18,0|234=20,0|231=22,0|238=24,0|229=26,0|223=28,0|225=30,0|241=32,0|222=34,0|227=36,0|226=38,0|234=40,0|222=42,0|227=44,0|218=46,0|219=48,0|215=50,0|229=52,0|219=54,0|218=56,0|227=58,0|228=60,0|224=62,0|228=64,0|220=66,0|234=68,0|227=70,0|229=72,0|224=74,0|222=76,0|226=78,0|229=80,0|231=82,0|229=84,0|228=86,0|236=88,0|235=90,0|237=92,0|237=94,0|226=96,0|236=98,0| 223=0,2|224=2,2|214=4,2|225=6,2|227=8,2|230=10,2|236=12,2|232=14,2|240=16,2|233=18,2|235=20,2|233=22,2|238=24,2|234=26,2|225=28,2|231=30,2|238=32,2|224=34,2|227=36,2|227=38,2|232=40,2|216=42,2|227=44,2|219=46,2|220=48,2|216=50,2|223=52,2|223=54,2|220=56,2|222=58,2|225=60,2|224=62,2|226=64,2|220=66,2|232=68,2|225=70,2|227=72,2|224=74,2|219=76,2|227=78,2|224=80,2|228=82,2|228=84,2|227=86,2|231=88,2|229=90,2|233=92,2|236=94,2|228=96,2|235=98,2| 227=0,4|225=2,4|216=4,4|233=6,4|226=8,4|225=10,4|231=12,4|229=14,4|235=16,4|229=18,4|233=20,4|230=22,4|235=24,4|230=26,4|226=28,4|229=30,4|237=32,4|226=34,4|228=36,4|227=38,4|227=40,4|224=42,4|232=44,4|222=46,4|225=48,4|219=50,4|0=52,4|227=54,4|228=56,4|223=58,4|229=60,4|224=62,4|231=64,4|223=66,4|231=68,4|227=70,4|229=72,4|227=74,4|230=76,4|233=78,4|229=80,4|238=82,4|227=84,4|233=86,4|238=88,4|235=90,4|0=92,4|240=94,4|236=96,4|237=98,4| 230=0,6|224=2,6|214=4,6|232=6,6|225=8,6|220=10,6|171=12,6|0=14,6|172=16,6|233=18,6|233=20,6|230=22,6|236=24,6|229=26,6|231=28,6|235=30,6|238=32,6|231=34,6|230=36,6|171=38,6|0=40,6|167=42,6|230=44,6|0=46,6|0=48,6|220=50,6|0=52,6|0=54,6|233=56,6|229=58,6|0=60,6|227=62,6|0=64,6|222=66,6|0=68,6|227=70,6|0=72,6|0=74,6|224=76,6|57=78,6|0=80,6|231=82,6|224=84,6|229=86,6|0=88,6|0=90,6|0=92,6|0=94,6|57=96,6|234=98,6| 231=0,8|228=2,8|226=4,8|232=6,8|225=8,8|226=10,8|232=12,8|233=14,8|0=16,8|232=18,8|236=20,8|232=22,8|235=24,8|233=26,8|113=28,8|57=30,8|58=32,8|114=34,8|230=36,8|230=38,8|235=40,8|0=42,8|234=44,8|224=46,8|230=48,8|225=50,8|0=52,8|231=54,8|228=56,8|227=58,8|171=60,8|229=62,8|116=64,8|224=66,8|172=68,8|226=70,8|228=72,8|235=74,8|226=76,8|118=78,8|230=80,8|233=82,8|230=84,8|231=86,8|233=88,8|236=90,8|0=92,8|241=94,8|236=96,8|236=98,8| 230=0,10|231=2,10|225=4,10|229=6,10|226=8,10|227=10,10|234=12,10|238=14,10|0=16,10|235=18,10|236=20,10|234=22,10|238=24,10|236=26,10|113=28,10|117=30,10|119=32,10|116=34,10|233=36,10|228=38,10|233=40,10|0=42,10|0=44,10|223=46,10|236=48,10|225=50,10|0=52,10|227=54,10|229=56,10|229=58,10|232=60,10|116=62,10|233=64,10|114=66,10|236=68,10|0=70,10|230=72,10|232=74,10|231=76,10|235=78,10|176=80,10|235=82,10|233=84,10|233=86,10|236=88,10|230=90,10|0=92,10|237=94,10|233=96,10|234=98,10| 231=0,12|231=2,12|168=4,12|113=6,12|174=8,12|224=10,12|234=12,12|236=14,12|0=16,12|228=18,12|235=20,12|230=22,12|236=24,12|234=26,12|220=28,12|233=30,12|235=32,12|230=34,12|228=36,12|226=38,12|230=40,12|0=42,12|173=44,12|0=46,12|174=48,12|224=50,12|170=52,12|0=54,12|227=56,12|225=58,12|228=60,12|0=62,12|232=64,12|0=66,12|231=68,12|169=70,12|0=72,12|171=74,12|232=76,12|0=78,12|58=80,12|234=82,12|228=84,12|234=86,12|240=88,12|0=90,12|0=92,12|235=94,12|240=96,12|236=98,12| End Object Zapped // Test at coords 383, 343 229=0,0|235=2,0|227=4,0|231=6,0|232=8,0|240=10,0|233=12,0|232=14,0|232=16,0|236=18,0|229=20,0|230=22,0|227=24,0|226=26,0|218=28,0|220=30,0|218=32,0|217=34,0|222=36,0|216=38,0|225=40,0|218=42,0|223=44,0|225=46,0|225=48,0|223=50,0|222=52,0|226=54,0|218=56,0|224=58,0|219=60,0|219=62,0|224=64,0|223=66,0|226=68,0|224=70,0|229=72,0|224=74,0|224=76,0|223=78,0|234=80,0|230=82,0|235=84,0|233=86,0|234=88,0|232=90,0|231=92,0|231=94,0|242=96,0|234=98,0| 225=0,2|233=2,2|113=4,2|229=6,2|116=8,2|235=10,2|231=12,2|232=14,2|234=16,2|235=18,2|232=20,2|232=22,2|229=24,2|226=26,2|222=28,2|225=30,2|224=32,2|219=34,2|225=36,2|222=38,2|228=40,2|227=42,2|227=44,2|225=46,2|229=48,2|226=50,2|220=52,2|227=54,2|228=56,2|226=58,2|225=60,2|227=62,2|233=64,2|230=66,2|233=68,2|231=70,2|236=72,2|0=74,2|231=76,2|227=78,2|241=80,2|236=82,2|238=84,2|235=86,2|236=88,2|233=90,2|231=92,2|230=94,2|240=96,2|234=98,2| 222=0,4|230=2,4|113=4,4|227=6,4|116=8,4|235=10,4|0=12,4|57=14,4|237=16,4|240=18,4|233=20,4|0=22,4|0=24,4|56=26,4|223=28,4|220=30,4|220=32,4|164=34,4|0=36,4|108=38,4|0=40,4|0=42,4|0=44,4|57=46,4|228=48,4|113=50,4|110=52,4|228=54,4|0=56,4|0=58,4|55=60,4|223=62,4|113=64,4|0=66,4|0=68,4|0=70,4|0=72,4|0=74,4|0=76,4|56=78,4|241=80,4|233=82,4|236=84,4|235=86,4|233=88,4|57=90,4|0=92,4|230=94,4|240=96,4|235=98,4| 227=0,6|236=2,6|229=4,6|0=6,6|235=8,6|0=10,6|236=12,6|232=14,6|233=16,6|236=18,6|230=20,6|0=22,6|0=24,6|231=26,6|220=28,6|223=30,6|227=32,6|0=34,6|229=36,6|225=38,6|232=40,6|232=42,6|0=44,6|233=46,6|235=48,6|227=50,6|227=52,6|0=54,6|0=56,6|229=58,6|230=60,6|230=62,6|233=64,6|231=66,6|0=68,6|231=70,6|237=72,6|0=74,6|233=76,6|237=78,6|242=80,6|236=82,6|241=84,6|236=86,6|236=88,6|115=90,6|235=92,6|234=94,6|238=96,6|235=98,6| 229=0,8|237=2,8|232=4,8|0=6,8|236=8,8|0=10,8|236=12,8|231=14,8|237=16,8|237=18,8|229=20,8|0=22,8|0=24,8|233=26,8|226=28,8|224=30,8|226=32,8|227=34,8|231=36,8|0=38,8|227=40,8|233=42,8|0=44,8|234=46,8|235=48,8|233=50,8|233=52,8|240=54,8|0=56,8|233=58,8|233=60,8|233=62,8|237=64,8|232=66,8|0=68,8|238=70,8|240=72,8|0=74,8|237=76,8|235=78,8|240=80,8|230=82,8|240=84,8|231=86,8|235=88,8|232=90,8|175=92,8|238=94,8|237=96,8|240=98,8| 229=0,10|240=2,10|230=4,10|0=6,10|235=8,10|235=10,10|0=12,10|57=14,10|233=16,10|58=18,10|0=20,10|0=22,10|0=24,10|228=26,10|224=28,10|220=30,10|223=32,10|113=34,10|0=36,10|171=38,10|228=40,10|0=42,10|0=44,10|230=46,10|235=48,10|113=50,10|0=52,10|174=54,10|0=56,10|227=58,10|231=60,10|232=62,10|116=64,10|0=66,10|0=68,10|237=70,10|0=72,10|0=74,10|241=76,10|232=78,10|240=80,10|233=82,10|237=84,10|232=86,10|234=88,10|0=90,10|56=92,10|232=94,10|237=96,10|232=98,10| 229=0,12|235=2,12|231=4,12|231=6,12|235=8,12|237=10,12|235=12,12|231=14,12|235=16,12|236=18,12|227=20,12|229=22,12|228=24,12|226=26,12|224=28,12|224=30,12|226=32,12|228=34,12|235=36,12|229=38,12|230=40,12|231=42,12|233=44,12|232=46,12|236=48,12|230=50,12|231=52,12|236=54,12|238=56,12|235=58,12|232=60,12|241=62,12|242=64,12|240=66,12|121=68,12|242=70,12|242=72,12|243=74,12|240=76,12|235=78,12|240=80,12|232=82,12|235=84,12|234=86,12|231=88,12|234=90,12|229=92,12|241=94,12|242=96,12|242=98,12| End