SRL Archive - SRL Suggestions

New Random Solvers


Dynamite

2012-01-20 11:26:58

DemiseScythe gets full credit for the actual solving of the random.
All I did was make it more suitable for an include.
In some solvers I have added failsafes etc.
Not all of the solvers are finished but the functionality is there.

These solvers are not ready for the include yet, they need more testing. If you have an account in any of the randoms listed below, please PM me the info.

Mordaut
Program Mordaut;
(*
Mordaut
=======

Written by: DemiseScythe/Dynamite
Solves the Mordaut Exam random.

*)
{$DEFINE TEST} // Uncomment to test separately from the SRL include
{$i srl/srl.simba}

var
Scimitar, LongSword, BattleAxe, Mace, Necklace, Tiara, HolyS, Ring: Integer;
PlateB, Bar, Ore, Pick, Arrows, Bow, Crossbow, ArrowT, RangedT, ArcherT, i, dx, dy: Integer;
Beer, Tea, Drink, ThirstyT, ThirstT, DehydratedT, HolySB, NecklaceB, RingB: Integer;
ShinyT, JewelleryT, BanglesT, Fish, Harpoon, FishingT, FishT, Candle, LampM: Integer;
A, B, C: Boolean;
Item: String;
aFound: Extended;

procedure Mordaut_LoadDTMs;
Begin
Scimitar := DTMFromString('mFQEAAHicnczLCoJQAITh6QHCJ1FJBFGKMA4nXUhC0qpl0N2uG9++vzgELmvgW8xiZijpijOO2OOAHS5onTsezg0brLHCAhYNltji5D7e2yc6TLKxsiRVHMWaTXPVVa3SFh9ROFLoB5obK5Obb/fY/Wrwh15esUEUgw==');
LongSword := DTMFromString('m6wAAAHic42ZgYLgOxLeA+C4QPwTiR0D8FIivAvEFID4NxCeB+DgQxwFxFBCHAXEQEPsDsS8QJwFxBhDnAXEhEJeA+OUVcFzU3MKQVlbGUNDYxJBdXQNmJ+TlMSQWFIDlSQGMJGAkAABfnRwx');
BattleAxe := DTMFromString('m6wAAAHiclcoxCoNAAETRsbbwCEGIjRZpUnkJESKyLiSwJItRNCDen3yNhWUceEwxE0q6BNIVOTIkSHHeetlPiPHg/0IPiwo3GBQo0ej3887L3Z1MZdQ+W03DpM53Gt/jutnaav7Ma0f8/xUcsMsXiNsTeg==');
Mace := DTMFromString('mwQAAAHic42RgYJjCyMAwC4hnA3E9EHcC8XQgngfEC6D0P6A6JiD9H0h/BuKfQMwB5LMBMTMQ/wbyrW2tGGztbRgMjPQZ/AJ8GTx9PMDsoNBAhui4KAYLK3MGfqA6QpiRCAwHAC59Eeo=');
Necklace := DTMFromString('m1gAAAHicjctNC0BAGATgcXXxqyRSOGvThvWx2Rb5+PmGtlx36mkO7zshgIEUzdQ5xvVFlkbKKKGUcqqooJoE9W4zGY3tPqDtAqlatGMPIRus5464jL9+bxF/fQSe/jyIGRRI');
Tiara := DTMFromString('m6wAAAHiclcrLCoJgAEThad3CF1NQ1H4trxQoKJJP2EXEpQtfyFO4cFkD32Y4R0lvPDYvPLdvwIQRC2aUKHBFggoGDToEcNF/ulsuL/DkuLZ84yu6GGVlqlMcfp3TWO29Ud1Wsuh/dfjDbit92Bkb');
HolyS := DTMFromString('mVAEAAHicpczBCoJAEAbgf5/A3qFbIJF56hBIKmR1WDBK13UVpUPv/wD9TXPq6sDHzPwDswKwNcCOYvObN2qt2V7zlA50pIosXWngj44c3WminkZ60UxvCpp5zb69piRJUZRnnPIS1tYIw4zqcoPrguyPp5M9y3LJmtZL9/0ot4g/ljAL/dcHqBMZvg==');
Ring := DTMFromString('mAAEAAHiclctBC0BAEAXgt1EOxK/cEhYrHDZswsXfdVYeKa479TXTzJsIgKaKWmqopI5qKih99z0Z8gUQvMKfmDw6mTnwzb3WqPMcm7WYhwGZlNi39en3rVEK1pgns0wjEv64EI7+dQG8UxnJ');
PlateB := DTMFromString('mfgEAAHicrczbCoJAEIDh6QmCXs3ETDysbrotRpF0kQi9ev8uEwjdOvAxw5wOInLHFaOa8MZLuVV/xoIPLDoYtGjUGSmOOKHCRfmVcFsiQa5/hrDnnRR1JUmWRqa30rlehtHL7fmIdZj/elmRS23bqDRNzOFuz68t7DbyH184syQ3');
Bar := DTMFromString('mAAEAAHic42FgYDgHxKeB+DwQXwHiE0B8Fip2GIiPQ8VvAfFlIE4A4jggDgfiKCBOAeJ0IM4G4gwgjgXiUKhcKhDnl+RjxWU15XDsF+QPx/xAPaRgRhIxMgAAAKYd5g==');
Ore := DTMFromString('maQEAAHicrcw7CsJQEIXhkxWICxAsLBREsBBBQbBPISiEcInX+ERD0MQHksat+yfezlIHPmaYOUxdUs+Tuuh7n7mNlpsbaKKDAUYYY4ohJm634o+BxQ5HnHDGGhEWzhxLlz04GzyyTK+i0NZa7eNYURjqkiSyxqi43/S85jJBoDxNq2x5K7Nln/l+ta/x51feH3zVG3UnH50=');
Pick := DTMFromString('m6wAAAHic42ZgYDgPxDeA+CEQPwfi40C8D4p3A/EOID4IxCeA+A8Q/wdiJkYGBhYg/gFkfwfiT0D8G4gZgGJvgdRTINbT1WHQUFdjUFVRZlBSVADT5iYmDPY2NgyW5uYM4cHBDC6OjgyO9nYM/ED1xGJGEjASAACMmBfR');
Arrows := DTMFromString('mqAEAAHicE2FgYBBkgAAOIOYCYhkglgNiaShbCoiFgFgEiPmBWAKIeYGYFaoehAWAWBiKQeYpAbEslOaEqmWG2iMENRdkniQQ8wAxNxCLQc0WhprJAdWXn5aDgj3sPRnCvMMZ/F0DwPTly6fA2NzAAs6+e/MyHIP0FGfmM3TUtDC0VDQw6ALNpCZmpDLGBgD/jiaD');
Bow := DTMFromString('mqAEAAHicE2FgYOAHYgkgVgZieSCWgfJFgFgIyucAYjEg5gVidgYIYARiJiBmAWJWqBoeIBaGmiMHxLJQDDJDGslcUah53EDMBjWPBWo2SIwPiAWg9pcXFzFcvnyKwcrSgsHT3Y0hPDSYIToynCE+NpohKMAfLHf31hUw3d3eytDf1cFgamIMVguSr6+uYmipr2NoqqsFs3WBZlITM1IZYwMAGboimA==');
Crossbow := DTMFromString('m/AEAAHick2BgYOADYm4gZgdiZgYIYIJiFiBmg7I5gZgfiIWAmBeIOaBscSCWAWJZIJYHYmGoHpB6HiAWgGIhqJwI1BwuqF3iUPVSQCwHxJJALAbVzwtVxwO1D+ROBai4KNTNbfVNDF3NbQx1FVUMzTX1DBM6exl6WjsYGqtrGUICQ8F0Q2UNQ2dTK0NsZCxDdVkNw61r58E4Oz2HIT+7gMHF0QUsB6JBemDyMyZNZdAF2kFLzEhjjAsAAN5XK6I=');
ArrowT := DTMFromString('m/AEAAHick2BgYFjKyMCwDIhXMELYi4B4ARDPBeJZQDwTiOcA8SogXgPE66F4ExBvBuKtQLwNiHcCcSUQ34SacxKIO4A4A2hHNhCnAXEqFGcCcRYUpyGJgdjpUHGYvlQoH8T2AmI/KB0PxHFAfPHsKQYYALHxYWwAmzhMDETzA2laYkYaY1wAAK4PN7M=');
RangedT := DTMFromString('mzgIAAHiczc7NCcJAEIbh2QrswW4UPFlBUGP8wRpEAoKCIoJBQRAE9WYbEvCQjnwXvwURIR4TePhmJrOb1M1s5czW7p0bbGWJuSyQYoappMo9DshwwlF8fcYFN1yV/r4cD9xRYIeEfxmhJ6EfYoBYc9/3lRE66GKsedhJVMc6H85F2m+gjRaaej9B8czNlKH+7P9Rtm9f3/m1X2NWBa4iyp8XRL5k7w==');
ArcherT := DTMFromString('megIAAHicxc27CQJBEIDhuQrswH4MDA2UVQsQY+EqsABrEEXuEEEQ9FAQFAUDk6vn/pUZWBY13YGPYR472xaRZSayxkatUKLAFnvsNB8CR5xQ4YwLruqmHpgjx0L3atwx4O8+HMYB37PZECPle73ojQv2bdfqDqbIMcMEXbxfz484rGfzX+IdiW5+u+/rFjmFLJH/0QCjkk/h');
Beer := DTMFromString('mpAIAAHicxc47CsJAFAXQcSduwCVYiKjxA1HxA1qmiIUrEQKRJCoSg7+oKKIW7sFWK8HNeGe4hnSWGTi8NzPvDpMWQmhQpDIUWHMxeZKzFaiBTnXqQA/67NuclbkGdJkr8bwFWdjCCVawhAX4tIY9nOFKR7jBBQ6wgYB52e8g5N0MpqzyXZfuzMtZx7LEeDRSNW7uOsrEtiMDw1CqmhZp6royNM3I6/VQfM8TYRCojNx/3k/ldy/7DP6QpFTC/q0vOVtZZw==');
Tea := DTMFromString('m0gEAAHicE2NgYBBghGBhIOYBYnYgZoNibqi4GBBLAbEEEMsBsSgQcwExMxCzArE0EPMDsSwQ/4eauQRILwDiWUA8G0qD+MuAeBUQr2GAqAHx5wDxBjS8BoqnQfWC1GwB4ubaBjBuqW+C48aaOob6qlqGuspqhgD/IIbw0EiGyPBoMJ2dmceQmZ7D0N3WCVZ39+ZlhsuXT8FpGNYFmk0LzEgjjB0AAHyZOP0=');
Drink := DTMFromString('mkwEAAHicE2ZgYBBgZGDgB2JeIOYGYk5GiJg4EIsCsTAQC0LFRKDqWKHqmKBynFD1DEDMDMQcQMwIxL+BQr+A+CcQ/wdiFqgdILOEoPgHUPwrEL8D4i8MELNBajoaqxna6oG4rpKhvaGaobetgaG7pZYhLTGCISEqiCE2IoAhMsSXISs1hiEvI4EhITqEoTQ/m6G8IJfByc6S4e7Ny2B8+fIpBl2gudTCjFTEWAAA7QooYw==');
ThirstyT := DTMFromString('mpAIAAHicxc49CgIxEIbhyQm8gtfZwsYLLMr6t4KHECsLO1EEBUWRLRRELATBXhD1Rr7gtxACsuUGHmbyZRJSNbOtM9u5X91jLRussMRCZphKhiMOOOGMC66eG1644405xhhhiAm6/KGPFtpI0FGWKmuoT3XWVN/TvcR7I88GmqkhQl018vYxPs+HWVD/ZSF/Jpwr2udZpWSuZEXrC4RPWBk=');
ThirstT := DTMFromString('muQIAAHiczc7BCkFREMbxuU/gGTyN2FjLiri4N5YWshNbcYkikkh4Bg8gFlY8jj93bk0iS6Z+nTnfTKcTF5GJE5pijBEGaog+uujpOcMCcyyxwRpbtUMbgb61wgEn3HDFHk00VJl/FODDQxE5CXNfVeAir3NXM0+VzOyRZ5FEAimkkUENLXRUHVVczscnMb3Nolxedt/ln+5211a0E6P/NecPfK07Y79Rsw==');
DehydratedT := DTMFromString('mtQMAAHic1c7fBgJBFMfx2SfoSXqOJLrb2G239DRFERFFF5Uo6SIiJYr0h6WL3qjv8FvW2r3ocoePc+bMOTNTNsbMHWMWmInNp5hgLEOMFAfooYu+rLFRXGGLHfY4JOIZR5wUL7jihjseeOGNJyLV7OxS79v3Qv7dEQ8+Wspd5VZTtXZq70o8F6TO/cQddjZUrZHoCcVTPVCvVUcVNVSUfz+RMYrpPEveuUndldWXd5a1j1fWWyXqReMU0F/rBwWmf8M=');
HolySB := DTMFromString('m5wEAAHictczLCgFxFMfx85fFFDYST+ENlCSXhUuKNMa4NXkNWbgkkZRXsjQrC+9hg/Ad/inJck59Ouf86pyEiBSQRVr3IvLIoIQyqmigBhN9zUITNlqooI4UcrjjgQtuuCKgRILq3b3dm2MIIY4owjB0FtGZoW8Uztzt1htZzxeyXa4+pqOxLCczGfYdcboDGdg96Vodsc32Fy9z3f2P0/HwkuS/X5SP/tQTCjc5OA==');
NecklaceB := DTMFromString('mqAEAAHicrczNCgFxFMbh4x7chguipMnHMMYkKylXIBNhmpEoUcpeiBALCx+pKbfjZ/rPiuWceno7dd4TF5EDttjjiDM2yg5X+HjipPYHLrjjpbprrODAxQhd9FT20cESUwwxgYc5ZhhjgbbyvdcKWckbulRqlpSrpmRyWpDJdEpKliG23RLdLIrrDeTt336E/XqzEfQS/IxSLGL/5gP6DD6f');
RingB := DTMFromString('mvQEAAHicE2VgYBBkZGAQYYTQYkAsDsTCQMwLxBJALADE3EDMAcRcQMwHxEJQmhWIWYCYByoPM4MdqocXqo4Lag5IHRtUDwgzAPFfIPUHiP8zQMxgZoSwfwDxLygNko+OjWSws7dl8AvwYdDQ0gBjd083hnu3rzBcvXoaTGPDfb1dDF0drQy9PR0MrS2NYLqpsY7BycWRQRdoLrUxIw0wVgAAf2AwoA==');
ShinyT := DTMFromString('mpAIAAHicxc7BCgFRFMbxO0/gFbwOGYaRyYa1LLwAS2XvDWxtKGWKiJAwC+WB/Ifv1nRTlnPr1znn3nNOt2iM2Xlfe2yxQYy14goLxSWOOOCEC8644o4HEuUvSXdPMcQYE8wwxwgBf6gglBqqaKAMX3WQ6fEl1H2a1xWbiNBGF3300FJvSQbo4JncPuyxtb1za+PMZN/dnl873dkCMU9ezv6dN9iGVfA=');
JewelleryT := DTMFromString('megIAAHicxc3NCkFREMDxOU/gDbyPlYW3UIp7fV5rW3kGlMgtUaSIsruysPI6/sMsJt1s79SvM3POzJyyiCyCyAxTzMO3XmJlUqyxxQ4bHLDHESdccMUNZ4wxwQgDJLb7jhcyxPzdQhs900DT8thq7emga/daRzYXudkEfQxRRwU1O1XV9mk8H9mHuNqHf/8983Lfk5drlAoSCvI/3gyVRLs=');
BanglesT := DTMFromString('mNwMAAHiczc7BCgFRFMbxM0/gMTyLha0HsJU0GBMLC7ORhQUvQJSiiKKISDamLJQH8r/NUTcmzXJu/Trnnm/uabIisnJEllhjgy12OGCv1dxPOOKMK264aA0tc8ywwBRjjNQEgepiqPvueOmunuZt+PxfFS48ZfqaRFlLmb5sfVtHQ+e+3l0r83Tu6ZuK9baJAAP00UEJeeRQQFGi83yEPz7z7xqX/9uRNIvrM9S0clIs4XkDYnBtZQ==');
Fish := DTMFromString('mjwIAAHick2dgYOBhZGAQAGJOIGYBYlYgZgLivwwQNh8QCwKxMBCLA7EEEEsDsQKULQvEKlA2SB0XVO93BggNMl8IiH8C2TJAWhmIlaB2/QeK/QLiPwwQ+X8MELvZgZgDiJmhapihbvoBZH+Fmv0Pav5vIGaD2ssNxLxQs0FqPwPxJ6j576FsZqhfsjLSGQrychjKS4sZ6uuqGaoqyxmKCvLAdE5WJkNGWgoYW9tYMri6OTMYmxiBaS9vD4YrV05j4Hu3r4AxLj6yuC7QHQOFGQcQEwAApd1XDw==');
Harpoon := DTMFromString('mpAIAAHicxc7fZ8JRGMfxp/+kfyAtKpspopvEJnZTRj/sS/oTIiXZpG+aRSNt/8duoiRayaxvUVr2p/T+fj1NN9Nlh5fznPM8Pue4RWSGT4wxwkD1YeEL31ovsMEPtlqvsNQ5O2uiWUPNsM9zzbDn1pr/gV/EcIM7pHCPjAqra1wigCsE4YVf+bQXQhRxJDQvhyRu9a0IDGRxgRezJeZjXZpPDamVq9Kqm1IplmS3WUjeKDj7W6cr7689p7as6Z9c+kE6z23n/j/H8wfHPQ9/OCfXmZ1ae0Wabk0=');
FishingT := DTMFromString('mJgIAAHicvc1PCoJAFMfxNydo34VE8h8FLvMsBm4iKARrEYgGdY+2gYU36hs+cQjd+uDDb+bNzJuliNyNyMN0eUOJ2lpf1QWF5hknHHHAHjukyPDBG0/kqBDy1wYufASItLdWHlYy3I01Az33rRmOtU+w1Wybl4hmry+793829mZqxq8WMzEzma4vrtRAfQ==');
FishT := DTMFromString('m5wEAAHictcxBCsIwFIThlxO47JlE26gFt4Xeo/seoauuPEdVUARtq8UL+YMThIDLPviY5A1JYmYXZ3Z13zzhrDyiQ48bHhjxwhNvadGgklpvDtjwf441Vva77+GxRYYUS+1y8doFOxRSYhruZspwDhN3cR93cb+YkZvRn/kAV600Aw==');
Candle := DTMFromString('m/AEAAHick2BgYOAAYn4GCOCDsnmAmBUqxgzE3FB1LEDMCcTsQMwLxFxQMVaoOAcShpkhBeWDzJAEYhUg1oFiJai8OhBrALEaVF4R6hYGqHuYoPbA7BUFYhEojo6NZ3ANcMWLk1MzGDKz8xhqG5oZ0jNzGLJzCzDUhIZFgsVT07MYEpPTGIJDwhkKi8sYdIF20BIz0hjjAgDyuSAf');
LampM := DTMFromString('mvQEAAHictc1PCwFRFAXwMyIpsvJpZkohK0KpUSYxmBiSUljMRkpRJFG+piz8Kzlv5i4tefXr3Xfv6b4UgK0GrGmlBfVBHOksM2VBS7GRzE5mezpJXs1DFKMExUWU3vzvheAOy/tJN7qKC93pIX1VR5h1xwNYdgNm3UTTsVEoF6FndBhpA9l8Dv2Ri1K1gnavg8F4CG/hYerN0GK26zqYzCd+xrRqfl71ktz9a9offD0fiKYxMw==');
End;

procedure Mordaut_FreeDTMs;
Begin
FreeDTM(Scimitar);
FreeDTM(LongSword);
FreeDTM(BattleAxe);
FreeDTM(Mace);
FreeDTM(Necklace);
FreeDTM(Tiara);
FreeDTM(HolyS);
FreeDTM(Ring);
FreeDTM(PlateB);
FreeDTM(Bar);
FreeDTM(Ore);
FreeDTM(Pick);
FreeDTM(Arrows);
FreeDTM(Bow);
FreeDTM(Crossbow);
FreeDTM(ArrowT);
FreeDTM(RangedT);
FreeDTM(ArcherT);
FreeDTM(Beer);
FreeDTM(Tea);
FreeDTM(Drink);
FreeDTM(ThirstyT);
FreeDTM(ThirstT);
FreeDTM(DehydratedT);
FreeDTM(HolySB);
FreeDTM(NecklaceB);
FreeDTM(RingB);
FreeDTM(ShinyT);
FreeDTM(JewelleryT);
FreeDTM(BanglesT);
FreeDTM(Fish);
FreeDTM(Harpoon);
FreeDTM(FishingT);
FreeDTM(FishT);
FreeDTM(Candle);
FreeDTM(LampM);
End;

Procedure Mordaut_Initiate;
var
DialogueCount : Integer;
Begin
A := False;
B := False;
C := False;
Item := 'none';
Writeln('We started Mordaut Exam Random Event!');
MakeCompass('n');
SetAngle(SRL_Angle_Low);
DialogueCount := 0;
Repeat
ClickToContinue;
Wait(1200 + Random(50));
Inc(DialogueCount);
Until DialogueCount = 4;
End;

Function Mordaut_QuestionType : String;
Begin
if FindColorTolerance(dx, dy, 13226706, 245, 31, 309, 42, 15) then
begin
Repeat
Writeln('We are to solve a big puzzle');
if FindDTM(ArrowT, dx, dy, MSX1, MSY1, MSX2, MSY2) or FindDTM(RangedT, dx, dy, MSX1, MSY1, MSX2, MSY2)or FindDTM(ArcherT, dx, dy, MSX1, MSY1, MSX2, MSY2) then
begin
Item := 'ranged';
Writeln('We found item type ' + Item + '!');
end;
if FindDTM(ThirstyT, dx, dy, MSX1, MSY1, MSX2, MSY2) or FindDTM(ThirstT, dx, dy, MSX1, MSY1, MSX2, MSY2) or FindDTM(DehydratedT, dx, dy, MSX1, MSY1, MSX2, MSY2) then
begin
Item := 'drinks';
Writeln('We found item type ' + Item + '!');
end;
if FindDTM(ShinyT, dx, dy, MSX1, MSY1, MSX2, MSY2) or FindDTM(JewelleryT, dx, dy, MSX1, MSY1, MSX2, MSY2) or FindDTM(BanglesT, dx, dy, MSX1, MSY1, MSX2, MSY2) then
begin
Item := 'jewellery';
Writeln('We found item type ' + Item + '!');
end;
if FindDTM(FishingT, dx, dy, MSX1, MSY1, MSX2, MSY2) or FindDTM(FishT, dx, dy, MSX1, MSY1, MSX2, MSY2) then
begin
Item := 'fishing';
Writeln('We found item type ' + Item + '!');
end;
until (Item <> 'none') or (i >= 10000);
Result := 'Big';
end else
begin
Writeln('We are to solve a small puzzle');
repeat
if FindDTMRotated(Scimitar, dx, dy, 41, 28, 482, 164, -Pi, Pi, Pi/30, aFound) or FindDTMRotated(LongSword, dx, dy, 41, 28, 482, 164, -Pi, Pi, Pi/30, aFound) or FindDTMRotated(BattleAxe, dx, dy, 41, 28, 482, 164, -Pi, Pi, Pi/30, aFound) then
Item := 'mweapon';
if FindDTMRotated(Necklace, dx, dy, 41, 28, 482, 164, -Pi, Pi, Pi/30, aFound) or FindDTMRotated(Tiara, dx, dy, 41, 28, 482, 164, -Pi, Pi, Pi/30, aFound) or FindDTMRotated(HolyS, dx, dy, 41, 28, 482, 164, -Pi, Pi, Pi/30, aFound) then
Item := 'jewelry';
if FindDTMRotated(PlateB, dx, dy, 41, 28, 482, 164, -Pi, Pi, Pi/30, aFound) or FindDTMRotated(Bar, dx, dy, 41, 28, 482, 164, -Pi, Pi, Pi/30, aFound) or FindDTMRotated(Ore, dx, dy, 41, 28, 482, 164, -Pi, Pi, Pi/30, aFound) then
Item := 'smithing';
if FindDTMRotated(Candle, dx, dy, 41, 28, 482, 164, -Pi, Pi, Pi/30, aFound) then
Item := 'fire';
Inc(i);
until (Item <> 'none') or (i >= 10000);
Result := 'Small';
end;
End;

procedure Mordaut_BigPuzzle;
Begin
case Item of
'ranged':
begin
Writeln('We must choose three ranged items!');
repeat
if (A = False) then
begin
if FindDTMRotated(Arrows, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found some arrows!');
Mouse(dx, dy, 3, 3, True);
A := True;
i := 0;
end;
end;
if (B = False) then
begin
if FindDTMRotated(Bow, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a bow!');
Mouse(dx, dy, 3, 3, True);
B := True;
i := 0;
end;
end;
if (C = False) then
begin
if FindDTMRotated(Crossbow, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a crossbow!');
Mouse(dx, dy, 3, 3, True);
C := True;
i := 0;
end;
end;
Inc(i);
until ((A = True) and (B = True) and (C = True)) or (i >= 100000);
end;
'drinks':
begin
Writeln('We must choose three ranged items!');
repeat
if (A = False) then
begin
if FindDTMRotated(Beer, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a beer!');
Mouse(dx, dy, 3, 3, True);
A := True;
i := 0;
end;
end;
if (B = False) then
begin
if FindDTMRotated(Tea, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found some tea!');
Mouse(dx, dy, 3, 3, True);
B := True;
i := 0;
end;
end;
if (C = False) then
begin
if FindDTMRotated(Drink, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found alcohol!');
Mouse(dx, dy, 3, 3, True);
C := True;
i := 0;
end;
end;
Inc(i);
until ((A = True) and (B = True) and (C = True)) or (i >= 100000);
end;
'jewellery':
begin
Writeln('We must choose three jewellery items!');
repeat
if (A = False) then
begin
if FindDTMRotated(HolySB, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a holy symbol!');
Mouse(dx, dy, 3, 3, True);
A := True;
i := 0;
end;
end;
if (B = False) then
begin
if FindDTMRotated(NecklaceB, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a necklace!');
Mouse(dx, dy, 3, 3, True);
B := True;
i := 0;
end;
end;
if (C = False) then
begin
if FindDTMRotated(RingB, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a ring!');
Mouse(dx, dy, 3, 3, True);
C := True;
i := 0;
end;
end;
Inc(i);
until ((A = True) and (B = True) and (C = True)) or (i >= 100000);
end;
'fishing':
begin
Writeln('We must choose three fishing items!');
repeat
if (A = False) then
begin
if FindDTMRotated(Fish, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a fish!');
Mouse(dx, dy, 3, 3, True);
A := True;
i := 0;
end;
end;
if (B = False) then
begin
if FindDTMRotated(Fish, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a fish!');
Mouse(dx, dy, 3, 3, True);
B := True;
i := 0;
end;
end;
if (C = False) then
begin
if FindDTMRotated(Harpoon, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a harpoon!');
Mouse(dx, dy, 3, 3, True);
C := True;
i := 0;
end;
end;
Inc(i);
until ((A = True) and (B = True) and (C = True)) or (i >= 100000);
end;
end;
i := 0;
A := False;
B := False;
C := False;
Item := 'none';
Mouse(430, 272, 3, 3, True);
ClickToContinue;
Wait(1200 + Random(50));
ClickToContinue;
Wait(1200 + Random(50));
End;

procedure Mordaut_SmallPuzzle;
var
DialogueCount : Integer;
Begin
case Item of
'mweapon':
begin
Writeln('We must do choose a Melee Weapon!');
repeat
if FindDTMRotated(Mace, dx, dy, 41, 164, 482, 303, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a Mace!');
Mouse(dx, dy, 3, 3, Mouse_Left);
Item := 'none';
end;
Inc(i);
until (Item = 'none') or (i >= 10000);
end;
'jewellery':
begin
Writeln('We must do choose a piece of Jewellery!');
repeat
if FindDTMRotated(Ring, dx, dy, 41, 164, 482, 303, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a Ring!');
Mouse(dx, dy, 3, 3, Mouse_Left);
Item := 'none';
end;
Inc(i);
until (Item = 'none') or (i >= 10000);
end;
'smithing':
begin
Writeln('We must do choose a smithing-related item!');
repeat
if FindDTMRotated(Pick, dx, dy, 41, 164, 482, 303, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a Pick!');
Mouse(dx, dy, 3, 3, Mouse_Left);
Item := 'none';
end;
Inc(i);
until (Item = 'none') or (i >= 10000);
end;
'fire':
begin
Writeln('We must do choose a fire item!');
repeat
if FindDTMRotated(LampM, dx, dy, 41, 164, 482, 303, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a Lamp!');
Mouse(dx, dy, 3, 3, Mouse_Left);
Item := 'none';
end;
Inc(i);
until (Item = 'none') or (i >= 10000);
end;
end;
Repeat
ClickToContinue;
Wait(1200 + Random(50));
Inc(DialogueCount);
Until DialogueCount = 4;
End;

procedure Mordaut_Solve; //DExam V0.8 Missing 50-65% of solutions and it is a bit chaotic, feel free to try and go through this if you want
Begin
Mordaut_LoadDTMs;
Mordaut_Initiate;
Repeat
case Mordaut_QuestionType of
'Big' : Mordaut_BigPuzzle;
'Small' : Mordaut_SmallPuzzle;
end;
until (TabExists(tab_Magic));
Mordaut_FreeDTMs;
end;

{$IFDEF TEST}
begin
clearDebug();
activateClient();
setupSRL();

Mordaut_Solve();
end.
{$ENDIF}

Mime
Program Mime;
(*
Mime
====

Written by: DemiseScythe/Dynamite
Stores all the routines to solve the Mime random.

*)
{$DEFINE TEST} // Uncomment to test separately from the SRL include
{$i srl/srl.simba}

var //Integers with T at the end are meant to read/detect Text.
LaughT, ThinkT, GlassBT, ClimbT, DanceT, CryT, GlassWT, LeanT, dx, dy: Integer; //If you can read the text otherwise, I'll be good, else these work.
Laugh, Think, GlassB, Climb, Dance, Cry, GlassW, Lean, Mark, i: Integer; //This group are frames of each emote, aimed to be the most unique frame.
Emote: String; //Holds value of current emote.
aFound: Extended;

procedure Mime_LoadDTMs;
Begin
LaughT := DTMFromString('mPwEAAHic42dgYMgE4jQozgLibCDOA+JCKC4G4gIgLkPCVVDcw8jA0MmIoPuBuBtJbAIQTwLiNiDuAuJeIO6Dqjm9ayZDW9t6OAYBZD4+zA9USy5mpACjAQAJRihw');
ThinkT := DTMFromString('mKgEAAHic42NgYNgNxDuBeBsUbwbiTVC8BohXQ/EKIF4HxEehuIeRgaEfiPuAuBuIu4C4HYh7kcQ6gLgNCYPEb58EmQTkt60nCfMD9YAwK4mYkUyMCgC56SkB');
GlassBT := DTMFromString('mIgMAAHiczc3fCgFREMfxc7SllOwDEBfIBcpLHn/W8hp75zk8g7eQiFK+m99hbsiVdurTb2bOqRk650b+aYC++jGmmGGi7KGDNromUzRNNlA3mcCjhrt7u+GCK844ykn7Nf+XkmOrPu7LeYOVzBG0s/v8wxxlJhfKzLzHe0EO+8KFsHsp69v8Ly3uVpGvqN/qASt6Y7Y=');
ClimbT := DTMFromString('maQEAAHicrcvLCYAwEATQSQViwyoq8RcV9WgRtmAPNuQE5hAinnTgsewOmwIoDJBRTiXVVJGlhnoaZKYpsNCmzu+t/joapROn/1XTRd117rD2gE84Y293L2H3lfnBIzd17CxD');
DanceT := DTMFromString('m0gEAAHicE2NgYMgG4lwonYGEU4E4CYpjoTgKiKuBOAwJRwJxCRAXAnEBEBdD1WxlZGDYAcSboBjG3w7FW6B4IxCvh7JB9GYg3oakDqZ2E5R9fOsMBhBoa1sPx+h8cjA/0AxaYEYaYewAAHufPNU=');
CryT := DTMFromString('maQEAAHicrctbCoAgEIVhXUG0affReySoXbH7EtpQv6QQ2GMDH3PgzJRCCI8BPSbM2HBix4oFFhp11MDAhV/5cDCwr91hhI853LWx11HI11EJpXQmTcpfN6krfiB/kM0NSHMwWQ==');
GlassWT := DTMFromString('mvQEAAHictcpPCkBAFIDx5wRWNgjFgohySAdxgZE/cQF3cByfGjVhYcGrX72Z7zkiElkiPjy4CBAi1hItRY4CGUpUhtowYcaIDj0UFt3O96D38/7aldG3tZWmUTfHPP2/6Tbta9YPHmcHorE03g==');
LeanT := DTMFromString('mEQIAAHicvcxNCoJQFIbh4woauzxBULCpkEGCDpwJBoGhi1Dyd9IeWpKvcK9chGbZgQe+88OxReRiiYRKhCtuiJEgRY4CdzwMJZ6ocUYAHx5cOMqADiNemDGhV/2o9jrrXWvkbpf1nZ593pVkWbNZy+x/4cTPo1l/8LUWrppJyA==');
Laugh := DTMFromString('mzgIAAHiczc7PSkJBFMfx4xP0Di4D4YIohhAtRPAlWqggLVpUtIk2IWgJLUQFcaELWwgiJGJI+S+Va4qCpNVCepe+Xs4NW7V14MOc3wxz5jhFZOIQmcLEAkt84kvrGYbo4gUt3Yeqhz46aOMZY7xp36n2mGk90b9MPdvsr7hnllskkMId4rjGJS5whnPNV7hBGnmUUUUDfYwxQAuPeEABGZziBDFEEcExwggd+mT9vpSnWk0qpaKUclkJHLgtQb/Hurdtss3OPsP1y+PaF7/b+JO339STMTHbHZmPRvK9+pBusylHXsOyxyy7wLEj/l8/f8hS7Q==');
Think := DTMFromString('mOwIAAHicvc3BSgJRFMbx4xP4AD5BojgwGKNCJEgQtA+ihbQQQcFa1LJNGyEI27h24RPYIsLAQSVnIGWcxkXREPQk/mc4uHQ5F358595zDycjIuuUiIOZWuJD3wJ84xd/+Feh9j4xxURnPfhYaW7wpffof5d9c9h4xRuGeMYTenjEA+5xhw5ucI02mrhCCw2t6+ocF+jj0spJxTTEMvJSzGfjjJweWXJSKYq3cGQ+Hsd1rWTuRP2zallKhYMdd3Arrm1LGGzkZ+3L+8sonjs+NOJMsy8pqQTtOVvHFkJ+');
GlassB := DTMFromString('mvQEAAHictcwxCwFxHMbx370Ck9dgU/+61OnKopQ3QiaTDJJ4BxYTNxlMBouNBYPOKXFOly6UDFZl803XlTLyq0/9nnp64iKy1UQc2FhihmmYN3DhYQ8fd5zwwBNHnHHFDQHa7HZgYYARJhhjiD66qKGBJlrhX0cF5VARBZRUQvIZQwyVjJi6+sg5MxXJpvW39Xwhru3IqleVy8GXYOdFnRi7v6b9wdd7AVVTNbI=');
Climb := DTMFromString('mEQIAAHicvc3PSkJhEIbx91xB664hPCCKopiCKOI/QiSoVbUQ6ibOQlsIBm5qIQiC23In5D4UhRAlDREFvROfY1/gxmUN/Bhm5oU5lfRlSZ8YYYgB+vgw+4n1k/nGDGMsTXZsdgussMYGW2OOKRz+VPCEF7Twii46aOMZj3jAvVHCLa5xgSySyOESd8ijgJuwrUwspFQkoETYr5DXVsA+U8Tv3XNn9+Zyc4fZ3z7oveut1VS97KhRqyofDSrq86iYONdVOq4T/vw16x8crR0M3TfR');
Dance := DTMFromString('mEQIAAHicvc09C0FxFMfx4xWYvQSLh7opuqWklPI2pEQpT0VY5CVYLG4m12wz6CLKIIpFiclE3oHvvf0HlJFTn+H3O6eOR0RWLpEZFlhijqmywwZbrD92lsoXHHHGAVfccMdD6fKnhwFGGGMCE0MYaKOl1FFGAVnUUEUJTXVjd0XkkEFaD4iuBSUc9L157VIxXZLRsCT0kET8XkenUZNKPut09i4e0eS0PzjZZmfT6MvassTNn19z/cHXeQKKJzq4');
Cry := DTMFromString('mUAIAAHicvc3PCgFRFAbwM0/gBbwAmahpMpOykvIKVsrCxizIvyKUhQWlxMbG0s7GVvInsrBgohiykAfx3XEoG8u59av73fN1j5uITIloAXNYwga2cIYjHKR3Zw8n2PF8zfc7PODJ9wv3b9wXf1hw5dzCzhXMYAIj6EIHBpzHMIUSFKECBchCGWqc85BjGZ6nwYAUiwd9FFICpAXkr1hYo4iuUDSk2lmVvT/vn5nIut9jE2/Napmsg0nDfo+MZILajbrdEURfdFzY6STJYf/OC33rP5A=');
GlassW := DTMFromString('mEQIAAHicvc3NCgFxFAXwM09g7REkk4mUaWKjlHcQC4qSCFE2kiVLjZXiBTwCiilZYHxENjYWNp7BmfFXUpbc+nXv6Xa7TgAbCZjSjBbSM1sOtKMlnelC8zcG3YUbXWlLe8G6PYnbDv8YNKIujcWsU5XKH71EecpQjopUEbsCZSlNSYpTihIhGZpfQVCREQsH7R6Q3Yiofju/WFn1uhDyeTDo6dB7fbTqNbSbDXtnWQ6rWEwmOJumnaNaAMfVGg7++TXpD77WA9kcPi4=');
Lean := DTMFromString('mUAIAAHicvc0/S0JRGMfxx1fQG2gT2pJABLuBEYQQNDo4CLroYOCfhrYLQYMKzoJuuuoiSJa6aAT9weGqQ2ii6BK4CL2BvvdwbqOjBz48v3P4HZ5DEflyiXQxwDN6Or9igm9YGOIDb5r9Zv9d4gcbbPGLBVaYY607c93Ps/MRLTTRQA1llFBEATk8wMQdskjpeYu0zhncIIkE4ggjgihihkf8J8fiOXKr6WRb8MynTK2R9J/a/3fHVcCvXJ56lXqtKoV7UwaVrLx0OjJ+/5TZaCyh4LlcXxiqe8DOfXLt2a7zB2AORbc=');
End;

procedure Mime_FreeDTMs;
Begin
FreeDTM(LaughT);
FreeDTM(ThinkT);
FreeDTM(GlassBT);
FreeDTM(ClimbT);
FreeDTM(DanceT);
FreeDTM(CryT);
FreeDTM(GlassWT);
FreeDTM(LeanT);
FreeDTM(Laugh);
FreeDTM(Think);
FreeDTM(GlassB);
FreeDTM(Climb);
FreeDTM(Dance);
FreeDTM(Cry);
FreeDTM(GlassW);
FreeDTM(Lean);
End;

Procedure Mime_Initiate;
Begin
Emote := 'none';
Writeln('We started Mime Random Event');
ClickToContinue;
MakeCompass('n');
SetAngle(SRL_Angle_Low);
MarkTime(Mark);
End;

procedure Mime_EmoteType;
Begin
repeat //Loops until it finds one of these emotes. It rotates throught he DTMs until it finds a match. If it doesnt find one it might
if FindDTMRotated(Laugh, dx, dy, 375, 34, 517, 220, -Pi/4, Pi/4, Pi/30, aFound) then //due to the mime doing emote in a different angle
Emote := 'laugh'; //or because it missed the frame due to this loop by
if FindDTMRotated(Think, dx, dy, 375, 34, 517, 220, -Pi/4, Pi/4, Pi/30, aFound) then //pure chance, this method is however effective and
Emote := 'think'; //if it doesnt find a emote, this loop will stall until
if FindDTMRotated(GlassB, dx, dy, 375, 34, 517, 220, -Pi/4, Pi/4, Pi/30, aFound) then //next emote giving it a chance to recognize the next one
Emote := 'glassb'; //not doing emotes is not a penalty in this random, only
if FindDTMRotated(Climb, dx, dy, 375, 34, 517, 220, -Pi/4, Pi/4, Pi/30, aFound) then //doing the wrong emote is.
Emote := 'climb';
if FindDTMRotated(Dance, dx, dy, 375, 34, 517, 220, -Pi/4, Pi/4, Pi/30, aFound) then
Emote := 'dance';
if FindDTMRotated(Cry, dx, dy, 375, 34, 517, 220, -Pi/4, Pi/4, Pi/30, aFound) then
Emote := 'cry';
if FindDTMRotated(GlassW, dx, dy, 375, 34, 517, 220, -Pi/4, Pi/4, Pi/30, aFound) then
Emote := 'glassw';
if FindDTMRotated(Lean, dx, dy, 375, 34, 517, 220, -Pi/4, Pi/4, Pi/30, aFound) then
Emote := 'lean';
until (Emote <> 'none') or (TimeFromMark(Mark) >= 600000);
Writeln('We found the ' + Emote + ' emote!');
End;

Procedure Mime_EmoteAction;
Begin
repeat //This loop clicks on the text matching the detected emote above and resets the value of the Emote string.
case Emote of
'laugh':
begin
Writeln('We must do laugh!');
Wait(6500 + Random(100)); //Waits for the text to appear
if FindDTM(LaughT, dx, dy, 7, 343, 513, 471) then //Finds DTM of the text and clicks on it
Mouse(dx, dy, 3, 3, True);
Emote := 'none'; //Resets the value of Emote, allows loop to break.
end;
'think':
begin
Writeln('We must do think!');
Wait(6500 + Random(100));
if FindDTM(ThinkT, dx, dy, 7, 343, 513, 471) then
Mouse(dx, dy, 3, 3, True);
Emote := 'none';
end;
'glassb':
begin
Writeln('We must do glass box!');
Wait(6500 + Random(100));
if FindDTM(GlassBT, dx, dy, 7, 343, 513, 471) then
Mouse(dx, dy, 3, 3, True);
Emote := 'none';
end;
'climb':
begin
Writeln('We must do climb rope!');
Wait(6500 + Random(100));
if FindDTM(ClimbT, dx, dy, 7, 343, 513, 471) then
Mouse(dx, dy, 3, 3, True);
Emote := 'none';
end;
'dance':
begin
Writeln('We must do dance!');
Wait(6500 + Random(100));
if FindDTM(DanceT, dx, dy, 7, 343, 513, 471) then
Mouse(dx, dy, 3, 3, True);
Emote := 'none';
end;
'cry':
begin
Writeln('We must do cry!');
Wait(6500 + Random(100));
if FindDTM(CryT, dx, dy, 7, 343, 513, 471) then
Mouse(dx, dy, 3, 3, True);
Emote := 'none';
end;
'glassw':
begin
Writeln('We must do glass wall!');
Wait(6500 + Random(100));
if FindDTM(GlassWT, dx, dy, 7, 343, 513, 471) then
Mouse(dx, dy, 3, 3, True);
Emote := 'none';
end;
'lean':
begin
Writeln('We must do lean on air!');
Wait(6500 + Random(100));
if FindDTM(LeanT, dx, dy, 7, 343, 513, 471) then
Mouse(dx, dy, 3, 3, True);
Emote := 'none';
end;
end;
Inc(i);
until (Emote = 'none') or (i >= 10) or (TabExists(tab_Inv));
i := 0;
End;

procedure Mime_Solve;
Begin
Mime_LoadDTMs;
Mime_Initiate;
Repeat
Mime_EmoteType;
Mime_EmoteAction;
until (TabExists(tab_Inv)) or (TimeFromMark(Mark) >= 600000);
if (TimeFromMark(Mark) >= 600000) then
begin //Logs out account if it takes 600000 ms and has not found Inv tab.
Writeln('We failed to solve the Mime random!');
Writeln('Logging out!');
Players[CurrentPlayer].Active := False;
Logout;
end;
Mime_FreeDTMs;
end;

{$IFDEF TEST}
begin
clearDebug();
activateClient();
setupSRL();

Mime_Solve();
end.
{$ENDIF}

Program Mime;
(*
Bee Keeper
=======

Written by: DemiseScythe/Dynamite
Stores all the routines to solve the Bee Keeper random.

*)
{$DEFINE TEST} // Uncomment to test separately from the SRL include
{$i srl/srl.simba}

var //Integers with T at the end are meant to read/detect Text.
Top, Middle, DoorA, DoorB, Legs, x, y: Integer;
aFound: Extended;
Found: Boolean;

procedure Bee_LoadDTMs;
Begin
Top := DTMFromString('mzgIAAHiczc5bCwFBFAfw4zv4BF6VJ6UUL0rkBUlWLbFC7qwVbdu633OL7+t/pqO8eTX1a5qZ8z9zfESUgRwkIQpBCIBfzvxugAUlaEIHRvJeg6zkY5CAvGQ0qEIXQhCGCMQhBWVIQwHaMkdR7vmfIczE9Munpi69h0KHimR5PhNaMmNZzpb8VZP6idCk7/m0pcf9pLyeF7pdD7RaOjQ2e2TbE7U3Gwbpukb7/ZIWc5tcd0aOM1VZruGdc9xjs3bVG/fget4H/TbttgvVn3Ed5/iec8fjmryY5R94/sTv9QaeDU9G');
Middle := DTMFromString('mPwEAAHic42dgYPAHYj0g1gFiQyAuBeJCKJ0PxCFAbA3EBlA1rkAcDsSeQHwKii8C8VUoPg/Ex4F4LxDvQcJHgPgKFIPkAnx8GDKSkxmS4+MZgvz9GFwcHcHY3cWZIS8zk6G6rIyhvbGRoaetjaEgO5vBz8uLwdPNDSwuCdRPLmakAKMBANifInU=');
DoorA := DTMFromString('m6wAAAHic42ZgYPCHYh8gDoJiENsSiP2AOA2IrYA4CYgLgDgHiHOhuAiKC4E4FojzgTgRig2MDBhU1VQZtHW0GJSUlcB8CytzhuDwYIa65lqGxLREhsy8TIaK2goGfqB6YjEjCRgJAABdRxIt');
DoorB := DTMFromString('mFQEAAHic42VgYAiAYl8gDgbiSCD2AGJdIC6E4myoGiMg1gPiPCDOBOICKAaxM6Bqi4E4FYijoTgKiJOAOCI8msHM1JwhPTWLISoyliEvt4ghLDSSwdXZnSEzPYchNjqeoaykEiyenZnH4OcTwMAP1EcqZiQDowAAUgwYbQ==');
Legs := DTMFromString('mFQEAAHic42VgYAgAYnsg1gRifSDOhooVAHEylA/C5lB5EJ4ExJOhuBOIO6AYxF8BxXOR2POBOC0pkSE2KpIhMjSUoaywgGFyXy9DR3MTWDwxLpahoriIoSA7GywH4oPUSQL1kYoZycAoAABZQh0s');
End;

procedure Bee_FreeDTMs;
Begin
FreeDTM(Top);
FreeDTM(Middle);
FreeDTM(DoorA);
FreeDTM(DoorB);
FreeDTM(Legs);
End;

Procedure Bee_Initiate;
Begin
Writeln('We started Bee Keeper Random Event');
ClickContinue(true, true);
TypeSend('2');
Wait(700 + Random(100));
ClickContinue(true, true);
End;

procedure Bee_FindAndMove;
Begin
repeat // Will make this a lot more neat when I have time - Boom
if FindDTMRotated(Top, x, y, MSX1, MSY1, 180, MSY2, -Pi/4, Pi/4, Pi/30, aFound) then
begin
DragMouse(x, y, 3, 3, 260, 47, 3, 3);
Writeln('We found the Top!');
Found := true;
end;
until (Found = true);
Found := False;

repeat
if FindDTMRotated(Legs, x, y, MSX1, MSY1, 180, MSY2, -Pi/4, Pi/4, Pi/30, aFound) then
begin
DragMouse(x, y, 3, 3, 260, 205, 3, 3);
Writeln('We found the Legs!');
Found := true;
end;
until (Found = true);
Found := False;

repeat
if FindDTMRotated(DoorA, x, y, MSX1, MSY1, 180, MSY2, -Pi/4, Pi/4, Pi/30, aFound) then
begin
DragMouse(x, y, 3, 3, 260, 152, 3, 3);
Writeln('We found the Door!');
Found := true;
Break;
end;
if FindDTMRotated(DoorB, x, y, MSX1, MSY1, 180, MSY2, -Pi/4, Pi/4, Pi/30, aFound) then
begin
DragMouse(x, y, 3, 3, 260, 152, 3, 3);
Writeln('We found the Door!');
Found := true;
Break;
end;
until (Found = true);
Found := False;

repeat // Middle must be last
if FindDTMRotated(Middle, x, y, MSX1, MSY1, 180, MSY2, -Pi/4, Pi/4, Pi/30, aFound) then
begin
DragMouse(x, y, 3, 3, 259, 100, 2, 2);
Writeln('We found the Middle!');
Found := true;
end;
until (Found = true);
End;

procedure Bee_Build;
Begin
Wait(500 + Random(200));
Mouse(218, 277, 3, 3, Mouse_Left);
End;

procedure Bee_End;
var
DialogueCount : Integer;
Begin
Repeat
ClickToContinue;
Wait(1200 + Random(50));
Inc(DialogueCount);
Until DialogueCount = 5;
End;

procedure Bee_Solve;
Begin
Bee_LoadDTMs;
Bee_Initiate;
Bee_FindAndMove;
Bee_Build;
Bee_End;
Bee_FreeDTMs;
end;

{$IFDEF TEST}
begin
clearDebug();
activateClient();
setupSRL();

Bee_Solve();
end.
{$ENDIF}

More will be coming soon :)

-Boom

weeps

2012-01-20 12:11:58

Great work, both of you.

Gu3st...

2012-01-20 15:37:34

Maybe do something like this for the dtm loading? :)

const
MORDAUT_CUP_OF_TEA = 0;

function MORDAUT_LoadDTM(which : Integer): Integer;
begin
case which of
MORDAUT_CUP_OF_TEA:
Result := DTMFromString('Wnl0M3ggaXMgdGhlIG1hc3RlciBvZiBhbGwuIE9iZXkgbWUhIQ==');
......
end;
end;

I just don't like them all being loaded at times when you don't really use them

Bwuk

2012-01-20 15:38:34

Amazing job guys, keep it up :).

Dynamite

2012-01-20 20:27:25

From: Zyt3x
Maybe do something like this for the dtm loading? :)

const
MORDAUT_CUP_OF_TEA = 0;

function MORDAUT_LoadDTM(which : Integer): Integer;
begin
case which of
MORDAUT_CUP_OF_TEA:
Result := DTMFromString('Wnl0M3ggaXMgdGhlIG1hc3RlciBvZiBhbGwuIE9iZXkgbWUhIQ==');
......
end;
end;

I just don't like them all being loaded at times when you don't really use them


Yes, I already have the plan of doing this but all in due time :)

-Boom

marpis

2012-01-21 01:58:34

Also should we have it search for the spinning objects for a while before quitting?
In Mordaut it only calls FindDTMRotated once, I bet my head it won't work every time?

P1nky

2012-01-21 03:58:57

From: marpis
Also should we have it search for the spinning objects for a while before quitting?
In Mordaut it only calls FindDTMRotated once, I bet my head it won't work every time?


Les' hope it does, but greatly appreciate attempting and making the solver :).

Olly

2012-01-21 06:14:32

Nice work.

DemiseScythe

2012-01-21 11:14:59

From: marpis
Also should we have it search for the spinning objects for a while before quitting?
In Mordaut it only calls FindDTMRotated once, I bet my head it won't work every time?


Idk exactly what changes he did but this is the original.

repeat
if FindColorTolerance(dx, dy, 13226706, 245, 31, 309, 42, 15) then
begin
Writeln('We are to solve a big puzzle');
if FindDTM(ArrowT, dx, dy, MSX1, MSY1, MSX2, MSY2) or FindDTM(RangedT, dx, dy, MSX1, MSY1, MSX2, MSY2)or FindDTM(ArcherT, dx, dy, MSX1, MSY1, MSX2, MSY2) then
begin
Item := 'ranged';
Writeln('We found item type ' + Item + '!');
end;
if FindDTM(ThirstyT, dx, dy, MSX1, MSY1, MSX2, MSY2) or FindDTM(ThirstT, dx, dy, MSX1, MSY1, MSX2, MSY2) or FindDTM(DehydratedT, dx, dy, MSX1, MSY1, MSX2, MSY2) then
begin
Item := 'drinks';
Writeln('We found item type ' + Item + '!');
end;
if FindDTM(ShinyT, dx, dy, MSX1, MSY1, MSX2, MSY2) or FindDTM(JewelleryT, dx, dy, MSX1, MSY1, MSX2, MSY2) or FindDTM(BanglesT, dx, dy, MSX1, MSY1, MSX2, MSY2) then
begin
Item := 'jewellery';
Writeln('We found item type ' + Item + '!');
end;
if FindDTM(FishingT, dx, dy, MSX1, MSY1, MSX2, MSY2) or FindDTM(FishT, dx, dy, MSX1, MSY1, MSX2, MSY2) then
begin
Item := 'fishing';
Writeln('We found item type ' + Item + '!');
end;
case Item of
'ranged':
begin
Writeln('We must choose three ranged items!');
repeat
if (A = False) then
begin
if FindDTMRotated(Arrows, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found some arrows!');
Mouse(dx, dy, 3, 3, True);
A := True;
i := 0;
end;
end;
if (B = False) then
begin
if FindDTMRotated(Bow, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a bow!');
Mouse(dx, dy, 3, 3, True);
B := True;
i := 0;
end;
end;
if (C = False) then
begin
if FindDTMRotated(Crossbow, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a crossbow!');
Mouse(dx, dy, 3, 3, True);
C := True;
i := 0;
end;
end;
Inc(i);
until ((A = True) and (B = True) and (C = True)) or (i >= 100000);
i := 0;
A := False;
B := False;
C := False;
Item := 'none';
Mouse(430, 272, 3, 3, True);
end;
'drinks':
begin
Writeln('We must choose three ranged items!');
repeat
if (A = False) then
begin
if FindDTMRotated(Beer, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a beer!');
Mouse(dx, dy, 3, 3, True);
A := True;
i := 0;
end;
end;
if (B = False) then
begin
if FindDTMRotated(Tea, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found some tea!');
Mouse(dx, dy, 3, 3, True);
B := True;
i := 0;
end;
end;
if (C = False) then
begin
if FindDTMRotated(Drink, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found alcohol!');
Mouse(dx, dy, 3, 3, True);
C := True;
i := 0;
end;
end;
Inc(i);
until ((A = True) and (B = True) and (C = True)) or (i >= 100000);
i := 0;
A := False;
B := False;
C := False;
Item := 'none';
Mouse(430, 272, 3, 3, True);
end;
'jewellery':
begin
Writeln('We must choose three jewellery items!');
repeat
if (A = False) then
begin
if FindDTMRotated(HolySB, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a holy symbol!');
Mouse(dx, dy, 3, 3, True);
A := True;
i := 0;
end;
end;
if (B = False) then
begin
if FindDTMRotated(NecklaceB, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a necklace!');
Mouse(dx, dy, 3, 3, True);
B := True;
i := 0;
end;
end;
if (C = False) then
begin
if FindDTMRotated(RingB, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a ring!');
Mouse(dx, dy, 3, 3, True);
C := True;
i := 0;
end;
end;
Inc(i);
until ((A = True) and (B = True) and (C = True)) or (i >= 100000);
i := 0;
A := False;
B := False;
C := False;
Item := 'none';
Mouse(430, 272, 3, 3, True);
end;
'fishing':
begin
Writeln('We must choose three fishing items!');
repeat
if (A = False) then
begin
if FindDTMRotated(Fish, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a fish!');
Mouse(dx, dy, 3, 3, True);
A := True;
i := 0;
end;
end;
if (B = False) then
begin
if FindDTMRotated(Fish, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a fish!');
Mouse(dx, dy, 3, 3, True);
B := True;
i := 0;
end;
end;
if (C = False) then
begin
if FindDTMRotated(Harpoon, dx, dy, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a harpoon!');
Mouse(dx, dy, 3, 3, True);
C := True;
i := 0;
end;
end;
Inc(i);
until ((A = True) and (B = True) and (C = True)) or (i >= 100000);
i := 0;
A := False;
B := False;
C := False;
Item := 'none';
Mouse(430, 272, 3, 3, True);
end;
end;
ClickToContinue;
Wait(1200 + Random(50));
ClickToContinue;
Wait(1200 + Random(50));
{ClickToContinue;
Wait(1200 + Random(50));
ClickToContinue;
Wait(1200 + Random(50));}
end else
begin
Writeln('We are to solve a small puzzle');
repeat
if FindDTMRotated(Scimitar, dx, dy, 41, 28, 482, 164, -Pi, Pi, Pi/30, aFound) or FindDTMRotated(LongSword, dx, dy, 41, 28, 482, 164, -Pi, Pi, Pi/30, aFound) or FindDTMRotated(BattleAxe, dx, dy, 41, 28, 482, 164, -Pi, Pi, Pi/30, aFound) then
Item := 'mweapon';
if FindDTMRotated(Necklace, dx, dy, 41, 28, 482, 164, -Pi, Pi, Pi/30, aFound) or FindDTMRotated(Tiara, dx, dy, 41, 28, 482, 164, -Pi, Pi, Pi/30, aFound) or FindDTMRotated(HolyS, dx, dy, 41, 28, 482, 164, -Pi, Pi, Pi/30, aFound) then
Item := 'jewelry';
if FindDTMRotated(PlateB, dx, dy, 41, 28, 482, 164, -Pi, Pi, Pi/30, aFound) or FindDTMRotated(Bar, dx, dy, 41, 28, 482, 164, -Pi, Pi, Pi/30, aFound) or FindDTMRotated(Ore, dx, dy, 41, 28, 482, 164, -Pi, Pi, Pi/30, aFound) then
Item := 'smithing';
if FindDTMRotated(Candle, dx, dy, 41, 28, 482, 164, -Pi, Pi, Pi/30, aFound) then
Item := 'fire';
Inc(i);
until (Item <> 'none') or (i >= 10000);
Writeln('We found items type ' + Item + '!');
i := 0;
repeat
case Item of
'mweapon':
begin
Writeln('We must do choose a Melee Weapon!');
repeat
if FindDTMRotated(Mace, dx, dy, 41, 164, 482, 303, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a Mace!');
Mouse(dx, dy, 3, 3, Mouse_Left);
Item := 'none';
end;
Inc(i);
until (Item = 'none') or (i >= 10000);
end;
'jewelry':
begin
Writeln('We must do choose a piece of Jewelry!');
repeat
if FindDTMRotated(Ring, dx, dy, 41, 164, 482, 303, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a Ring!');
Mouse(dx, dy, 3, 3, Mouse_Left);
Item := 'none';
end;
Inc(i);
until (Item = 'none') or (i >= 10000);
end;
'smithing':
begin
Writeln('We must do choose a smithing-related item!');
repeat
if FindDTMRotated(Pick, dx, dy, 41, 164, 482, 303, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a Pick!');
Mouse(dx, dy, 3, 3, Mouse_Left);
Item := 'none';
end;
Inc(i);
until (Item = 'none') or (i >= 10000);
end;
'fire':
begin
Writeln('We must do choose a fire item!');
repeat
if FindDTMRotated(Lamp, dx, dy, 41, 164, 482, 303, -Pi, Pi, Pi/30, aFound) then
begin
Writeln('We found a Lamp!');
Mouse(dx, dy, 3, 3, Mouse_Left);
Item := 'none';
end;
Inc(i);
until (Item = 'none') or (i >= 10000);
end;
end;
Inc(i);
until (Item = 'none') or (i >= 10);
i := 0;
ClickToContinue;
Wait(1200 + Random(50));
ClickToContinue;
Wait(1200 + Random(50));
ClickToContinue;
Wait(1200 + Random(50));
ClickToContinue;
Wait(1200 + Random(50));
end;
until (TabExists(tab_Magic));

You notice the giant repeat loop? is there for it searches 1+ times. It actually checks hundreds of times in a matter of seconds.

Brandon

2012-01-21 11:26:21

From: DemiseScythe
Idk exactly what changes he did but this is the original.
You notice the giant repeat loop? is there for it searches 1+ times. It actually checks hundreds of times in a matter of seconds.


I only see a giant infinite loop :S if the dtm's are never found then we're stuck in the randoms.

Coh3n

2012-01-21 13:21:23

Dynamite, I've been working on an entire new system that will replace the old one. You can keep organizing Demise's code if you wish, but I'll still be changing it further. Here's Evil Bob I just finished. I haven't tested everything together yet, but I will later today.

(*
Evil Bob
========

Written by: DemiseScythe & Coh3n
Stores all the routines to solve the Evil Bob random.

*)

{$IFNDEF IS_INCLUDE}
{$i srl/srl.simba}
{$i common.simba}
{$ENDIF}

const
DTM_EB_COUNT = 14;
DTM_EB_NET_GROUND = 0;
DTM_EB_NET_INV = 1;
DTM_EB_POT = 2;
DTM_EB_FISH_COOKED = 3;
DTM_EB_FISH_RAW = 4;
DTM_EB_BOB = 5;
DTM_EB_SLAVE = 6;
DTM_EB_STATUE_NORTH = 7;
DTM_EB_STATUE_SOUTH = 8;
DTM_EB_STATUE_EAST = 9;
DTM_EB_STATUE_WEST = 10;
DTM_EB_FISHSPOT = 11;
DTM_EB_CENTER = 12;
DTM_EB_PORTAL = 13;

var
EB_DTMs: array[0..(DTM_EB_COUNT - 1)] of Integer;

// Returns true if player is in the random
function EB_Detect(): Boolean;
var
x, y: Integer;
begin
if (FindColorTolerance(x, y, 9931907, 611, 9, 643, 162, 15)) then
if (not TabExists(TAB_MAGIC)) then
Result := TabExists(TAB_PRAYER);
end;

procedure EB_SetDTMs();
var
i: Integer;
begin
EB_DTMs[DTM_EB_NET_GROUND] := DTMFromString('mggAAAHicY2NgYFBlZGDQAmI1RghbFoh1gXgTUG47EO8A4tVAvJkBImagJsNw7ug8DMwPlMOGGXFgCAAA6w0Q6Q==');
EB_DTMs[DTM_EB_NET_INV] := DTMFromString('mbQAAAHicY2VgYGBngAAeIOYDYiYgZgNiViDmAmJmBhhgAmNBPm4wLS8hxMAPZKFjRiwYDAA6qgEK');
EB_DTMs[DTM_EB_POT] := DTMFromString('mwQAAAHic42RgYBBjZGCQBGJ+IOYCYnYgFgFiRSBmAGJtIE4GMrOBOAuIE4E4A4jzoPwcKN1aX8ewVEqFYZk0BEtISjCIS0gwSElLMyQkpjLER0cx8APVEcKMRGA4AACDdQxK');
EB_DTMs[DTM_EB_FISH_COOKED] := DTMFromString('mwQAAAHic42RgYLBnYmBwBGJbILYBYjsgdgViDyD2AWJfIH4OVPcEiB8yQNivofRjIH4ApbO99RhkLE4zBFkqg9kNcbYMuT76DFH26gy+ZooMsQ4aDPxAdYQwIxEYDgAsOBLV');
EB_DTMs[DTM_EB_FISH_RAW] := DTMFromString('mrAAAAHic42BgYHBgYmBwBGI7ILYHYlcg9gRiHyD2A+LnQDVPgPgxEL9igPAfAfF9qJhs2Q0GGcsLDBKJmxjkqx8yyJXfZhCPW8sgGjqHQTJlBwM/UA0+zEgAwwAAVtET5Q==');
EB_DTMs[DTM_EB_BOB] := DTMFromString('mlwAAAHicY2dgYLgHxPeB+A6UfgDEd6HiE4C4F4i7gbgDiCcD8RQgng7EJkZGYGxjZcmgo6XFICMtzWBlbs5gb2PDwA+Ux4UZ8WAoAAAu4Q6J');
EB_DTMs[DTM_EB_SLAVE] := DTMFromString('mQwAAAHicY2ZgYDBkhGATIJ4G5E8G4ilAXJ2jylCZpcLQUqLBwA/kwzAjEgYCAOekBb0=');
EB_DTMs[DTM_EB_STATUE_NORTH] := DTMFromString('mAAEAAHic42FgYHBgZGCwB2IbIHaFskHYCYgtgNgKKu4JxAFAvAWoZycDhN4OxBuAeDUQL4bi9UC8GYpBcpsnmzHsnW3J8PqgO8PcRn2GQ/OtGE4vtwWLb5pkxnBzkyPD/rmWDBdW2zMcX2zDwA/UQwpmJBEjAwD7vB91');
EB_DTMs[DTM_EB_STATUE_SOUTH] := DTMFromString('mPwEAAHic42dgYBBkZGDgBmIBKM0FxMJALMIIkROFioOwNBBLQcXFgHg9UP8uIN4DxIeB+DQUHwLiFUC8HIhnAvEiIJ4NxEuAeD4QLwDipmwNhqUdxgwdBVoM6SHyDMu7jBkWtRoxtORqMKzrNwXj7mJthopkVYaZdfoM5UkqYPaqHhMGfqB+cjEjBRgNAACAhx5Y');
EB_DTMs[DTM_EB_STATUE_EAST] := DTMFromString('mVAEAAHicpcw7CsJgEIXR6wp0LaKdGIyFbsxO3IAoGHwGAz4Lm6BgI0iKiCREFDvBVfgl/JVtBg4zMHemJClBjJeZH7jjhhBPRAjMLvU2N2luhT0OxhE+POzgYooZxhhhiAH6cDplLXtVRWs7c3ZqcrsVBQtL8cbWdW4p2Tb18VsKvUaWuUzq+p7aWS/yI49CTv/1A6QHNIs=');
EB_DTMs[DTM_EB_STATUE_WEST] := DTMFromString('m6wAAAHic42ZgYLgPxI+A+B4Q3wXi50D8DEnsKRA/BOInQHwViG9B8WMgvgLE54H4LBCfAeKTQHwMiPeC6MW2DOkh8gwz6/QZZjcYMJQnqTDUZagzLGgxZNg5w5JheZcxw5FFNgzzmw0Z+IHqicWMJGAkAADn6CG2');
EB_DTMs[DTM_EB_FISHSPOT] := DTMFromString('mWAAAAHicY2FgYFAFYhUg1gRieSDmZ2Rg4ARiASAWBOLazkUMC5euhGN+kBokzIiGQQAAkaEIiA==');
EB_DTMs[DTM_EB_CENTER] := DTMFromString('mbQAAAHicY2VgYChhYmDIAuJuIO4H4nQgtgGKawKxOhC7A7EPEB/b08bglCTLoBQhDMYgNj9QHB0zYsFgAABcVgiC');
EB_DTMs[DTM_EB_PORTAL] := DTMFromString('mKgEAAHic42NgYNgJxLuAeBMQrwfiDVCxg0C8FoiPAfEOIF4NxBuhckeAeCUQLwTiJUC8HKp3I1R8B5K564B4PhDPhapdsNQfJ27q0ILj/YfKUDA/UC85mJFMjAoAKusqzA==');

for i := 0 to High(EB_DTMs) do
SetDTMName(EB_DTMs[i], 'Evil Bob '+ToStr(i));
end;

procedure EB_Setup();
begin
if (not LoggedIn) then
Exit;

ClickNorth(SRL_ANGLE_HIGH);
EB_SetDTMs();
end;

function EB_GetNet(): Boolean;
var
x, y, r, t: Integer;
begin
if (not LoggedIn) then
Exit;

Writeln('EB_GetNet: Getting fishing net');

Result := WaitDTM(x, y, EB_DTMs[DTM_EB_NET_INV], 200); // may already have a net

if (not Result) then
begin
// walk to the red dots on the SE part of the island
TPAWalk(721128, 15, 5, -5, Point(MMX2, MMY2));
Wait(2000 + Random(500));

// drop items if needed
if (InvCount > 26) then
begin
Writeln('Dropping items');

t := (GetSystemTime + 5000);
repeat
r := RandomRange(10, 16); // random slots, probably not important items
if (ExistsItem(r)) then
begin
DropItem(r);
Wait(1000 + Random(500));
end;
until((InvCount <= 26) or (GetSystemTime > t));
end;

// pick up net off the ground
if (ClickMSDTM(EB_DTMs[DTM_EB_NET_GROUND], -Pi/4, Pi/4, Pi/30, ['ake', 'net'], mouse_Left)) then
begin
if (DidRedClick) then
begin
Result := WaitDTM(x, y, EB_DTMs[DTM_EB_NET_INV], 5000); // look for net in inventory

if (not Result) then
Writeln('DB_GetNet: Didn''t find DTM_EB_NET_INV');
end;
end else
Writeln('EB_GetNet: Didn''t click DTM_EB_NET_GROUND');
end;

if (Result) then
Writeln('EB_GetNet: Got fishing net');
end;

// Returns true if player relocated to the center of the island
function EB_WalkToCenter(): Boolean;
var
x, y: Integer;
aFound: Extended;
begin
Writeln('EB_WalkToCenter: Walking to the center of the island');

if (FindDTMRotated(EB_DTMs[DTM_EB_CENTER], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/30, aFound)) then
begin
if (Distance(x, y, MMCX, MMCY) > 10) then // may already be at center
begin
Mouse(x, y, 3, 3, true);
Wait(1500 + Random(300));
Flag;
end else
Writeln('EB_WalkToCenter: Already at center');

Result := true;
end else begin
Writeln('EB_WalkToCenter: Didn''t find DTM_EB_CENTER');
Result := TPAWalk(63717, 10, RandomRange(-5, 5), RandomRange(-5, 5), Point(MMCX, MMCY));
end;

if (Result) then
Writeln('EB_WalkToCenter: At center');
end;

// Talks to slave to start cut scene
procedure EB_TalkToSlave();
var
v: TVariantArray;
i: Integer;
begin
if (not LoggedIn) then
Exit;

Writeln('EB_TalkToSlave: Talking to the Slave');

v := [EB_DTMs[DTM_EB_SLAVE], -Pi/4, Pi/4, Pi/30, ['ervent'], mouse_Left];
if (WaitFuncEx('ClickMSDTM', v, 50, 5000)) then
begin
if (WaitFunc(@AreTalking, 50, 4000)) then
for i := 1 to 4 do // click through 4 dialogs
begin
ClickContinue(true, true);
Wait(300 + Random(200));
end;
end else
Writeln('Didn''t find DTM_EB_SLAVE');
end;

// returns the statue we need to fish at
function EB_GetStatue(): string;
var
dtmTemp, i, x, y, t: Integer;
DTMs: TIntegerArray;
results: TStringArray;
aFound: Extended;
begin
if (not LoggedIn) then
Exit;

Writeln('EB_GetStatue: Identifying statue');

Result := '';
t := (GetSystemTime + 60000);

results := [ 'north', 'east', 'south', 'west' ];
DTMs := [ DTM_EB_STATUE_NORTH, DTM_EB_STATUE_EAST,
DTM_EB_STATUE_SOUTH, DTM_EB_STATUE_WEST ];

repeat
for i := 0 to High(DTMs) do
if (FindDTMRotated(EB_DTMs[DTMs[i]], x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4, Pi/30, aFound)) then
begin
Result := results[i];
Break;
end;
until((Result <> '') or (GetSystemTime > t));

if (Result <> '') then
Writeln('DB_GetStatue: Found statue '''+Result+'''')
else
Writeln('DB_GetStatue: Didn''t identify statue');

ClickContinue(true, true); // need to do this whether or not it fails
end;

// Relocates to center, walks to fishing spots and returns true when cooked fish is found
function EB_GetFish(Direction: string): Boolean;
var
dtmFishSpot, dtmFish, x, y: Integer;
v: TVariantArray;
begin
if (not LoggedIn) then
Exit;

Writeln('EB_GetFish: Getting fish');
Result := WaitDTM(x, y, EB_DTMs[DTM_EB_FISH_COOKED], 200); // may already have fish

EB_WalkToCenter(); // make sure we're at the center of the island

if (not Result) then
begin
case Direction of
'north': TPAWalk(10864595, 15, 10, 10, Point(MMCX, MMY1));
'east': TPAWalk(10864595, 15, 0, 0, Point(MMX2, MMCY));
'south': TPAWalk(10864595, 15, 0, -5, Point(MMCX, MMY2));
'west': TPAWalk(10864595, 15, 5, 0, Point(MMX1, MMCY));
end;

Wait(1500 + Random(500));

v := [EB_DTMs[DTM_EB_FISHSPOT], -Pi, Pi, Pi/30, ['ishing'], mouse_Left];
if (WaitFuncEx('ClickMSDTM', v, 50, 5000)) then
begin
if (DidRedClick) then
if (WaitDTM(x, y, EB_DTMs[DTM_EB_FISH_COOKED], 10000)) then // wait to find cooked fish
Result := true
else
Writeln('EB_GetFish: Didn''t find DTM_EB_FISH_COOKED');
end else
Writeln('EB_GetFish: Didn''t click DTM_EB_FISHSPOT');
end;

if (Result) then
Writeln('EB_GetFish: Got fish')
end;

function _EB_UncookFish(): Boolean;
var
x, y: Integer;
begin
if (not LoggedIn) then
Exit;

Writeln('EB_UncookFish: Uncooking the fish');
Result := WaitDTM(x, y, EB_DTMs[DTM_EB_FISH_RAW], 200); // may already have uncooked the fish

EB_WalkToCenter();

if (not Result) then
begin
// click the cooked fish
if (FindDTM(EB_DTMs[DTM_EB_FISH_COOKED], x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(x, y, 5, 5, mouse_Left);

// use the fish on the uncooking pot
if (ClickMSDTM(EB_DTMs[DTM_EB_POT], -Pi, Pi, Pi/30, ['ncook'], mouse_Left)) then
begin
// wait for the fish to be uncooked
if (WaitDTM(x, y, EB_DTMs[DTM_EB_FISH_RAW], 5000)) then
Result := true
else
Writeln('EB_UncookFish: Didn''t find DTM_EB_FISH_RAW')
end else
Writeln('EB_UncookFish: Didn''t click DTM_EB_POT');
end else
Writeln('EB_UncookFish: Didn''t find DTM_EB_FISH_COOKED');
end;

if (Result) then
Writeln('EB_UncookFish: Uncooked the fish');
end;

function EB_FeedBob(): Boolean;
var
x, y, t: Integer;
begin
if (not LoggedIn) then
Exit;

Writeln('EB_FeedBob: Feeding Bob');

if (FindDTM(EB_DTMs[DTM_EB_FISH_RAW], x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(x, y, 5, 5, mouse_Left);

if (ClickMSDTM(EB_DTMs[DTM_EB_BOB], -Pi, Pi, Pi/30, ['vil', 'ob'], mouse_Left)) then
begin
Wait(1500 + Random(500));

t := (GetSystemTime + 15000);
while (GetSystemTime > t) do
begin
if (FindNPCChatText('actually', Nothing)) then
begin
Result := true;
Writeln('EB_FeedBob: Fed Bob');
Break;
end;

ClickContinue(true, true);
end;
end else
Writeln('EB_FeedBob: Didn''t find DTM_EB_BOB');
end else
Writeln('EB_FeedBob: Didn''t find DTM_EB_FISH_RAW');
end;

function EB_Exit(): Boolean;
var
v: TVariantArray;
begin
if (not LoggedIn) then
Exit;

Writeln('EB_Exit: Exiting Evil Bob random');

v := [EB_DTMs[DTM_EB_PORTAL], -Pi, Pi, Pi/30, ['ortal'], mouse_Left];
if (WaitFuncEx('ClickMSDTM', v, 50, 5000)) then
begin
Result := true;
Writeln('EB_Exit: Clicked portal');
end else
Writeln('EB_Exit: Didn''t find DTM_EB_PORTAL');
end;

procedure EB_Free();
var
i: Integer;
begin
for i := 0 to High(EB_DTMs) do
FreeDTM(EB_DTMs[i]);
end;

function EB_Solve(): Boolean;
var
t: Integer;
statue: string;
begin
t := (GetSystemTime + (5 * 60000)); // maximum 5 minutes

EB_Setup();

repeat
if (EB_GetNet()) then
begin
EB_WalkToCenter();
Wait(1000 + Random(500));

EB_TalkToSlave();

statue := EB_GetStatue();

if (statue <> '') then
repeat // since statue was found, keep trying to do the rest
if (EB_GetFish(statue)) then
begin
EB_WalkToCenter();

if (_EB_UncookFish()) then
if (EB_FeedBob()) then
Result := EB_Exit();
end;
until(Result or (GetSystemTime > t));
end;
until(Result or (GetSystemTime > t));

EB_Free();
end;

{$IFNDEF IS_INCLUDE}
begin
ClearDebug();
ActivateClient();
SetupSRL();

EB_Solve();
{
EB_SetDTMs();
EB_Exit();
EB_Free();
}
end.
{$ENDIF}

Dynamite

2012-01-21 13:24:45

Coh3n would you prefer me to keep organizing or not? :-)
I have frog done and started Scape Rune.

-Boom

DemiseScythe

2012-01-21 13:27:24

ScapeRun is also known as Bob Fishing or Evil Bob as far as I know

Dynamite

2012-01-21 13:37:08

From: DemiseScythe
ScapeRun is also known as Bob Fishing or Evil Bob as far as I know


ScapeRune is the one with the animal shaped balloons :)

-Boom

doublex8

2012-01-21 13:40:12

From: Dynamite
ScapeRune is the one with the animal shaped balloons :)

-Boom


Thought that was prison pete?

Dynamite

2012-01-21 13:42:52

I stand corrected, sorry xD

-Boom

Coh3n

2012-01-21 14:46:19

From: Dynamite
Coh3n would you prefer me to keep organizing or not? :-)
I have frog done and started Scape Rune.

-Boom
Honestly, I'd prefer you not to. Not that you can't script or anything, but I trust myself to organize Demise's code rather than you, if that makes sense (don't mean to offend you in any way). You're probably just better off using your time on something else.

That being said, I'm still going to use parts of what you have to make sure I don't miss anything. I'm hoping this week I'll have a new branch setup in SRL so people can actually test it in their scripts. :)

E: Also moved thread to SRL Suggestions.

Dynamite

2012-01-21 20:18:20

From: Coh3n
Honestly, I'd prefer you not to. Not that you can't script or anything, but I trust myself to organize Demise's code rather than you, if that makes sense (don't mean to offend you in any way). You're probably just better off using your time on something else.

That being said, I'm still going to use parts of what you have to make sure I don't miss anything. I'm hoping this week I'll have a new branch setup in SRL so people can actually test it in their scripts. :)

E: Also moved thread to SRL Suggestions.


Ok that's fine :)

-Boom