Log in

View Full Version : How do I make my script upload SRL stats?



TheGuyWhoGotOn
08-06-2007, 03:24 AM
I'm nearly finished my auto-woodcutter, however I want people to be able to upload their stats to SRL. Here is my script so far (It will run, with VERY few bugs, there are just a few things I need to add).


program SimpleLogCutter;
{.include srl/srl.scar}
{.include srl/srl/extended/xautotalk.scar}
{.include srl/srl/extended/xantiban.scar}
{.include SRL/SRL/Misc/PlayerForm.scar}
{.include SRL/SRL/Skill/Woodcutting.scar}

var yougetsome, xx, yy, yourinv, users, h, m, s, nogametab1, darkness, cut, dead, deads, lvltouse, lost: integer;
tc: array[1..10] of integer;
logs: array[1..5] of integer;
nofirstslot: string;

procedure setup;
begin
status('Setting up players');
SetupPlayers;
Users:= GetNumber;
end;

procedure setcb;
begin
status('Setting up colours and bitmaps');
yougetsome := BitmapFromString2(False, 'a677B078DAB5575B92C' +
'42008BC9266828F4FCD64EE7FA40DB353AE2902429CCD4757 AA83' +
'0AB4A071CE7970C7E3FD7A60C83BA25F1043407EC3AF50908 1844' +
'C80D4F8B096660FAFD06C9684B3016C8D0F68E292CB074678 216E' +
'B8F0F2E6C333225664625D1B1FCBE3CFFEF16C36FB9ADF367 BCD0' +
'592AFA5D4849E1CCF87E9F81363C5DF197AD48F5D728E7081 8AB1' +
'17B1C85ECD602D7B5E5886BEEB91EAA2F7CAAA8B7E2CA7CBB 7D4E' +
'1BC9DD78E53EA167EA2105774E4E16C68BC83F9493E4FAB88 9997' +
'2DF5B3C9A3E4782F6C48A59C6C1886D3459307BAA3A8CF278 6CEA' +
'0509FAA467D93B5E8EBCBDAA5597BCE5B5223839CD05AE819 5A2F' +
'FD3B53E9FA8A18D49458FBFA7A1CA863ED6C335D42C1B30CA 3854' +
'11D71E79BD5D19C7A443B6E157D679BBFC3DCDC8772E615D5 64E8' +
'6C5CCF9957878962901945BFBAA98EA27B98772C8D4813231 72F7' +
'3CAC8F5CE5A1AEF2783B5E4B35B3CE5A7EE038C6AD61EA851 67A0' +
'CB77FF0834B77DF9FC956FBF337F61337F04FF8124333F131 ');
tc[10]:= 9087930
tc[9]:= 2781296
tc[8]:= 3096632
tc[4]:= 1718328
tc[5]:= 199690
tc[2]:= 2908240
tc[1]:= 1724488
tc[7]:= 2252880
tc[6]:= 3295304
tc[3]:= 3823696
logs[1]:= 5411248
logs[2]:= 5345198
logs[3]:= 5542835
logs[4]:= 6129318
logs[5]:= 6063524
yourinv := BitmapFromString2(False, 'a944CC78DACD55490E8' +
'5200CBD52F553862538DCFF48DF5613302A14D144172FA613 7DB4' +
'B400D0190F0BAA7E41ED26C28EFFB526FC0DA425000CAC054 5680' +
'8D1EA28411B7DD96B8DD65BB64492E0CCF6640216DC820667 C201' +
'091D297AD6EA99B58A229891BD02464950D197BDB668239FA 8395' +
'D80E07DB0FEA3E83CDA4E6E7F64F4358E907C2D113649F013 57B6' +
'1C8D2D377C995D7ACA3DA6BB3809C7DDED1D18156CF2960D3 D26D' +
'1163A33ADE331E7AC567EE772A64D1C25B94938663BBC85E3 49F5' +
'D739934C9B9338175590480ADACAD9F54A1DB3356AE2786B3 E3FC' +
'051D251E2F7553173E45DD73273B27956DCAA642FA4AFE36A 2357' +
'6E6AC91BBFEAAEDA5DF607F0D');
dead := BitmapFromString2(False, 'a9E16B78DAAD924B0E80200C4' +
'4AF54083F9745F1FE47922A2124156844162F6418D2C90000 0086' +
'0CB03BC1D3DE064734A92A3A18DA3F9E934E9DA64B0E4977D 112B' +
'DAA8AD547A6F22622C6802DE15E5C2F8C98365DD8F32CB09D 0E6C' +
'F10C2F9E36E1D8294832CEC027F632749DE2FEB93EEE64924 A306' +
'BDCD824A7B801C9BB7CEC642195E49FFF95EA02269');
lvltouse := BitmapFromString2(False, 'aA65C078DACD5A5B92A33' +
'00CBC126143209F3093DCFF481B33A91A28AC76EBC5840F15 658C' +
'1FB2D46ACBEEBAAE7B7EBD44B74C2F313C8ABC8DD7DFF7619 597B' +
'EC8DBADC8EB5CBE4EE5BD9FD69A43696178AE5F4BC56EEC4B C9F8' +
'7DFB7D5F4ACD717816F9351439FF2BF597D7FBF5F1B8BCDE2 FE37' +
'599E7659A7F64B73EDB9286BCCFC37411A5E7DFFE7E1F87F7 78D6' +
'F79DC4FFDAE47654B4062A1A5BE6C7BDAF94ACF25D7F5372A A3C8' +
'C47FD179EE9A7C9D811C2D6D4BEA39454FB5A1F8C95B49785 E98A' +
'C71F1B261C30E73D72A13EFE4AF5C24B3FD69D6F9F9237619 C21D' +
'A0F8E5C79D1C13F069B3EE9E8F3C711EA945816803F369F82 EB6B' +
'448F28E6E3673BD9B674EC45B2019B6D64F099BC96F37A211 820E' +
'F41365FA39013FBD427309F3CB489929051FC19DB391F0395 F613' +
'CCF679E4F47021EC35EEDD7D58FCCA60A4029AEDF44C44B40 F623' +
'2846456A43B3C0D4D1E1140B922BBBE98F11028B16D0DB74F CD7A' +
'A33DAC998A2D1D668A5707D76C940B0C9FE95D4215DE122A3 5699' +
'B54D81B5D4EAD14C607A1BC316B026345CBC75A25D0324357 DA72' +
'8585F0E32198860243684D4A7F05200CC179F2668A2DD0632 7521' +
'DCA8A3026F0382C7884D10279BF33AD08AF19BFCF2AD69458 0B6D' +
'D60897F311908FA78D5D18B13B536898CE55623C69940B6C0 7C79' +
'14ABFCC084D5C0EAF7865D5709C25D88ED6DEFCB864CCA39A 626B' +
'405CC69A11B80DC64CD1DE24EB15769154FB6EB6935153F22 3A6C' +
'D462F2664D0B2056D6E87E931630C3BBEE4D709B4AE23E754 5875' +
'A8BD29BEF2DEC4EFE2952B95114F5D3595A70F54041172477 8F76' +
'D3B01316600B271923F4783F949C983025082C8B437664D64 E11A' +
'3315A26A83BB4A711F67290966C5307FDE561B3952A6173FD 6317' +
'95D61CC985979E232DE71B8722952DC11EC2485ED24E4E518 6DF3' +
'91BAC2163C275936ED29776DBB9B8D364E4570664FF40FE3E 1902' +
'7A8B9502C3786A7608D7E719464509DB1A528B6035B08F0FA 8C73' +
'0D3FDBE135C9B01D3E8FC1E49AFC6C8799B5F60602663541E CB11' +
'2971DB941F5998ECD0283E2A02B56D2F7AC440D67B31DD369 9427' +
'2FF7396C27D81E84730451FFF0349CBF8F843381F8840EE35 585F' +
'9F0B91D9EED84E6D0146CC7CD331571848905FCEC6CEB0EE3 821A' +
'DFF8FB7244E6E124AF87B777A458C39F64FD07856');
end;

function udead: boolean;
begin
result:= findbitmap(dead, xx, yy);
end;

procedure recievelogs;
var waited: integer;
begin
waited:= 0
repeat
status('Waiting for logs');
wait(500 + random(500));
waited:= waited + 1;
until((findbitmap(yougetsome, xx, yy))or(findbitmap(yourinv, xx, yy))or(waited = 20))
end;

procedure clicktree;
var click: boolean;
number: integer;
begin
number:= 1
repeat
status('Clicking Tree');
click:= true
if click = true then
begin
if findmscolor(xx, yy, tc[number]) then
begin
mouse(xx, yy, 3, 3, true);
click:= false
end;
wait(10);
end;
number:= number + 1
until((click = false)or(number = 11))
end;

function findtree: boolean;
begin
if (findmscolor(xx, yy, tc[1]))or(findmscolor(xx, yy, tc[2]))or(findmscolor(xx, yy, tc[3]))or(findmscolor(xx, yy, tc[4]))or(findmscolor(xx, yy, tc[5]))or(findmscolor(xx, yy, tc[6]))or(findmscolor(xx, yy, tc[7]))or(findmscolor(xx, yy, tc[8]))or(findmscolor(xx, yy, tc[9]))or(findmscolor(xx, yy, tc[10])) then result:= true
end;

function lastlog: boolean;
begin
if (findcolorTolerance(xx, yy, logs[1], 694, 436, 710, 459, 75))or(findcolorTolerance(xx, yy, logs[2], 694, 436, 710, 459, 75))or(findcolorTolerance(xx, yy, logs[3], 694, 436, 710, 459, 75))or(findcolorTolerance(xx, yy, logs[4], 694, 436, 710, 459, 75))or(findcolorTolerance(xx, yy, logs[5], 694, 436, 710, 459, 75)) then result:= true
end;

function invcolourtol(colour, tolerance: integer): boolean;
var xx, yy: integer;
begin
result:= findcolortolerance(xx, yy, colour, 567, 211, 729, 454, tolerance)
end;

procedure clickinvcolourtol(colour, tolerance: integer; left, ran: boolean);
var xx, yy: integer;
begin
if findcolortolerance(xx, yy, colour, 567, 211, 729, 454, tolerance) then
begin
wait(100 + random(200));
if ran = false then mouse(xx, yy, 0, 0, left);
if ran = true then mouse(xx, yy, 3, 3, left);
end;
end;

procedure nextaccount;
begin
if Users > 0 then
begin
status('Switching accounts');
writeln('You were logged out, next user');
nextplayer(false);
loginplayer;
wait(2000 + random(1000));
makecompass('N');
HighestAngle;
fixchat;
end;
end;

procedure droplogs;
var number: integer;
attempts: integer;
begin
number:= 3
repeat
status('Dropping logs');
if invcolourtol(logs[1], 75) then
begin
if nofirstslot = 'yes' = false then
begin
clickinvcolourtol(logs[1], 75, false, true);
wait(350 + random(250));
if chooseoption(xx, yy, 'rop ') then cut:= cut + 1
end;
end;
wait(900 + random(500));
if invcolourtol(logs[2], 75) then
begin
if nofirstslot = 'yes' = false then
begin
clickinvcolourtol(logs[2], 75, false, true);
wait(350 + random(250));
if chooseoption(xx, yy, 'rop ') then cut:= cut + 1
end;
end;
if invcolourtol(logs[number], 75) then
begin
clickinvcolourtol(logs[number], 75, false, true);
wait(350 + random(250));
if chooseoption(xx, yy, 'rop ') then cut:= cut + 1
end;
number:= number + 1
if number = 6 then number:= 3
wait(200 + random(200));
if LoggedIn = false then
begin
if users > 0 then users:= users - 1
Nextaccount;
end;
if getcurrenttab = 4 = false then gametab(4)
attempts:= attempts + 1
if attempts = 40 then
begin
writeln('Cannot drop some kind of object, logging out');
logout;
end;
until((lastlog = false)or(loggedin = false)or(attempts = 40))
attempts:= random(10);
end;

function events: boolean;
var xx, yy: integer;
begin
result:= false
status('Waiting for all fights and walking');
if findmmcolor(xx, yy, 255) then result:= true
if (findcolor(xx, yy, 255, 253, 150, 270, 163))or(findcolor(xx, yy, 65280, 253, 150, 270, 163)) then result:= true
end;

procedure mcbox(xx, yy, xx2, yy2: integer; lefft: boolean);
begin
xx:= xx + random(xx2 - xx)
yy:= yy + random(yy2 - yy)
mouse(xx, yy, 0, 0, true);
end;

function FindFastRandoms: Boolean; //By WT-Fakawi.
var
i: Integer;
begin
for i := 1 to 8 do
begin
case I of
1: if UDead then
begin
status('You died, going to oak tree in Lumby');
Result := True;
wait(3000 + random(1500));
mouse(633, 139, 5, 5, true);
deads:= deads + 1
end;
2: if FindMod then
begin
Result := True;
status('Found MOD, waited');
end;
3: if FindMime then
begin
status('Stupid mime, logging out');
Result := True;
if users > 0 then users:= users - 1
wait(2000 + random(1000));
makecompass('N');
HighestAngle;
fixchat;
end;
4: if FindMaze then
begin
status('In maze, logging out');
Result := True;
if users > 0 then users:= users - 1
wait(2000 + random(1000));
makecompass('N');
HighestAngle;
fixchat;
end;
5: if FindQuiz then
begin
status('Being quized, logging out');
Result := True;
if users > 0 then users:= users - 1
wait(2000 + random(1000));
makecompass('N');
HighestAngle;
fixchat;
end;
6: if FindDemon then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;
status('A Game tab is missing, logging out');
writeln('A gametab is missing! Random? Logging out...');
nogametab1:= nogametab1 + 1
Logout;
Exit;
end;
end;
7: begin
if InBlack then
begin
Result := True;
status('In dark area, logigng out');
writeln('You are in a dark area, random? Logging out...');
darkness:= darkness + 1
Logout;
Exit;
end;
end;
8: RC;
end;
wait(1);
end;
end;

procedure fixrandoms;
begin
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
findnormalrandoms;
findfastrandoms;
if findfight then
begin
writeln('You are under attack');
runto('n', true);
status('Under attack, running away');
end;
if findbitmap(lvltouse, xx, yy) then
begin
writeln('You lost all your axes, logging out...');
lost:= lost + 1
logout;
end;
end;

begin
SetupSRL;
setcb;
setup;
readln('WARNING, this only works with regular trees and oak trees, please try to avoid others. Will be for more trees when this script is out of beta...');
nofirstslot:= readln('Ignore more colours? ("yes" if the bot keeps dropping your axe(s)) WARNING, I think it may drop with axes still, sorry, I`m not too sure');
movetotray;
FindWindowBySize(766, 504)
activateclient;
mcbox(521, 5, 551, 432, true);
status('Logging in and setting up');
LoginPlayer;
wait(1500 + random(1500));
makecompass('N');
HighestAngle;
fixchat;
repeat
writeln(inttostr(users));
if users = 0 = false then
begin
if getcurrenttab = 4 = false then gametab(4)
if findtree then
begin
wait(2500 + random(1000));
clicktree;
recievelogs;
end;
events;
if lastlog then droplogs
wait(1000 + random(1000));
status('Performing anti-ban');
AntiBan;
status('Checking/fixing randoms');
fixrandoms;
if LoggedIn = false then
begin
if users > 0 then users:= users - 1
Nextaccount;
end;
end;
wait(10 + random(10));
until(Users = 0)
writeln(inttostr(users));
status('Setting Up Reports');
srlrandomsreport;
addtoreport('------Power Cutter By:-------');
addtoreport('-------TheGuyWhoGotOn--------');
addtoreport('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
ConvertTime(gettimerunning, H, M, S)
addtoreport('Time Run: ' + inttostr(H) + ':' + inttostr(M) + ':' + inttostr(S));
addtoreport('Logs Cut: ' + inttostr(cut));
addtoreport('Deaths: ' + inttostr(deads));
addtoreport('Axes Lost: ' + inttostr(lost));
addtoreport('Black Minimap: ' + inttostr(darkness));
addtoreport('-----------------------------');
end.

drnewheart
08-13-2007, 10:12 PM
Go to www.stats.srl-forums.com/ and everything you need to know is there.

Harry
08-13-2007, 10:19 PM
There are some good tuts on it.

TheGuyWhoGotOn
08-17-2007, 08:47 PM
Thanks, my question was answered in another topic :p, they posted a tut, I forget which one though, I really wish SRL would be updated so I could test my script.