Treasure hunting - guicampos/uo-scripts GitHub Wiki

Velland's Treasure Hunting

DISCLAIMER: "Please no unattended crafting, fishing, panning, resource gathering or killing mobs afk for ANY reason. If you are caught afk macroing resources, you will lose all gains and gear, zero tolerance policy."

I DO NOT SUPPORT NOR ENCOURAGE AFK MACROING. ALWAYS FOLLOW THE SHARD RULES.

Treasure hunting in ultima online was a nice creative and exciting challenge at the time it was created, when people needed to discover the spots with treasures from their maps using a sextant, geography hints, social networking, inteligente and other amazing tools available at that time.

But nowadays, with 20 or 30 years of obsolescence, treasure hunting is just another repetitive task that can be highly automated through macros. Many treasure hunting steps have already been automated, such as digging for the exact location of the treasure chest, opening it, and the infamous process of dragging a single coin from the chest, one by one, to maximize the appearance of monsters and ensure fat profits.

This system aims to automate the most boring and least inclusive part of treasure hunting: The automatic identification and travelling to the exact location of the treasure map where the treasure chest is. This is without having to go to websites with old and confusing maps, or having to spend minutes to identify a miserable dot in the middle of a low resolution image that doesn't match the game map at all, or simply ask your guildmates what point number you should recall to.

This script uses Orion's map reading capabilities to identify the XYZ location of the treasure spot from an opened map gump. But this isn't the most important aspect of this solution. The most important aspect of this system, and a secret that I have mapped manually, handmade, was the correlation between the coordinates (X,Y) of a treasure point in the game with the number of a tmap number on a tmap runebook from a public rune library. For example, I manually mapped (there are 200 spots!) that the tmap 56 is located at coordinates 468,2087 of the game. And that's how it was possible to automate the trip to a specific tmap, without the need to see on the map of the uo stratics where you should go.

  • This system will only identify felluca tmap locations!

Setup

Prerequisites

You'll need:

  • Your regular tmap hunting shovels, keys, macros, agents and so on.
  • one or more treasure maps inside your backpack
  • a place with a felucca public tmap library (suggestion: NEW'S Guild House)

image

OR

  • a personal public tmap library - a full tmap library that you carry on your backpack!

    If you have a full set of tmaps library (all 13 books) in your backpack, you'll be able to directly travel to a tmap spot from anywhere you are!

image

Setup

1 - Open the script tmaps.oajs and choose your tmap library type: 'backpack' or 'ground'.

image

2 - Create a 'Fast Call Gump' from Orion's Script tab, calling the function loop_tmap.

image

3 - Run the loop_tmap and let it running.

4 - Get a tmap, of any level of difficulty and open it by double clicking on it.

Usage

As simple as that! Let loop_tmap running and open a treasure map near a tmap library whenever you want to auto travel to a treasure spot!

image

Technical Details

API documentation

loop_tmap() This function is an infinite loop that runs until the program is stopped. It checks if the map is open and if so, it gets the map’s coordinates readed by a Orion's native feature and tries to correlate the opened coordinate with a tmap runebook location and position.If it finds the spot data, it gets the runebook, opens it and travels to the exact tmap spot found.

_tmap_get_map_xy() This function returns the coordinates of the map that is currently open.

_tmap_get_spot_data() This function returns the spot data for the current map. It splits the string at ‘;’ so every number,number:number is one different line. Then, it splits the line at ‘:’ so every number:number is a field (position 0) and number (position 1) is another field. This way, this line 961,506:1 will be: [‘961,506’,1] - where - element [0] is x,y and element [1] is the map_number.

_tmap_get_book_data(map_number) This function returns the runebook data for a given map number. For example, it will open the correct runebook for the tmap 25.

image

image

_tmap_check_spot_area(spot_xy, map_xy) This function checks if the spot area is within the map area. It splits the spot_xy and map_xy strings and converts them to integers. Then, it checks if the map coordinates are within 3 units of the spot coordinates. If so, it returns true. Otherwise, it returns false.

tmap mapping

Here is the complete mapping if one wants to use it elsewhere (you can also see this on tmaps_lib.oajs)


// x,y:tmap number
// then runebook is later calculated by checking where the tmap number is belong all the 12,5 runebooks needed to store 200 tmaps spots. The source code should talk to you.

var tmaps_coordinates_xy_position= '961,506:1;1162,189:2;1315,317:3;1469,230:4;1504,364:5;2672,392:6;2741,435:7;2770,345:8;2781,289:9;2836,233:10;3014,250:11;3082,202:12;1028,1181:13;
1318,889:14;1414,771:15;1530,753:16;1555,806:17;1510,968:18;1561,1058:19;1510,1071:20;2339,645:21;2350,689:22;2396,723:23;2433,767:24;2643,851:25;
2458,1042:26;2517,1066:27;2338,1159:28;2391,1155:29;3246,246:30;3403,238:31;3376,458:32;3369,638:33;199,1460:34;207,1442:35;359,1337:36;581,1453:37;
348,1565:38;619,1706:39;962,1859:40;979,1850:41;970,1884:42;969,1894:43;977,1880:44;1017,1859:45;1034,1877:46;1041,1903:47;1042,1958:48;1032,1972:49;
1024,1991:50;974,1992:51;989,1991:52;450,2054:53;478,2043:54;492,2027:55;468,2087:56;466,2100:57;1657,2030:58;1689,1992:59;1709,1964:60;1725,1999:61;
1732,2017:62;1742,2028:63;1753,2020:64;2034,1942:65;2054,1963:66;2065,1979:67;2058,1990:68;2070,2007:69;2062,1962:70;2098,1976:71;2089,1987:72;
2093,2006:73;2188,1991:74;1426,2405:75;1434,2381:76;1470,2340:77;1451,2301:78;1436,2294:79;1438,2217:80;1467,2181:81;1464,2246:82;1478,2273:83;
1562,2312:84;1545,2222:85;1518,2214:86;1533,2189:87;1522,2150:88;1541,2115:89;1594,2193:90;1618,2236:91;1654,2268:92;1724,2288:93;1773,2321:94;
1758,2333:95;1765,2431:96;1702,2318:97;1654,2304:98;2061,2144:99;2104,2124:100;2098,2101:101;2129,2108:102;2152,2120:103;2186,2143:104;2177,2151:105;
2161,2149:106;2130,2133:107;2123,2121:108;2647,2167:109;2628,2221:110;2642,2289:111;2682,2291:112;2727,2309:113;2781,2294:114;2804,2255:115;
2850,2252:116;2957,2150:117;2967,2171:118;2952,2177:119;2955,2200:120;2932,2240:121;958,2505:122;1025,2702:123;1290,2735:124;1382,2840:125;1390,2985:126;
1414,3059:127;1647,2642:128;1561,2699:129;1671,2808:130;1601,3013:131;1665,3063:132;1068,3182:133;1075,3156:134;1073,3133:135;1090,3110:136;
1093,3132:137;1096,3179:138;1129,3403:139;1162,3468:140;1127,3499:141;1785,1885:142;2014,3269:143;2040,3427:144;2094,3384:145;2148,3361:146;
2370,3427:147;2340,3482:148;2359,3508:149;2387,3506:150;2464,3583:151;2479,3624:152;2524,3587:153;2533,3608:154;2795,3451:155;2802,3488:156;
2793,3519:157;2829,3510:158;2988,3606:159;3035,3601:160;2154,3983:161;2144,3985:162;2140,3941:163;2157,3924:164;2152,3951:165;2162,3988:166;
2452,3942:167;2421,3929:168;2414,3920:169;2436,3902:170;2481,3908:171;2512,3899:172;2512,3920:173;2512,3962:174;2527,3982:175;2516,3998:176;
4479,3280:177;4475,3231:178;4465,3209:179;4423,3152:180;4418,3117:181;4447,3130:182;4452,3148:183;4498,3108:184;4512,3103:185;4471,3188:186;
4506,3226:187;4495,3240:188;4643,3371:189;4694,3484:190;3477,2761:191;3426,2723:192;3418,2675:193;3533,2471:194;3511,2421:195;3568,2402:196;
3702,2825:197;3594,2826:198;3557,2820:199;3541,2784:200'