SRL Archive - OSR Help

I'm gonna cry, I swear..


iEatApplez

2014-09-16 18:56:02

So I've had this problem for about 3 days now, I've tried everything possible I could think of and searched about every forum post for a solution but I just can't seem to get any..

Trying to start up BMPS, I've got a few there already and the script works fine.
But then, when I add another one, it starts to fuck up screaming I've made a type mismatch somehow. I've tried everything really…
Tried like 10 different BMPS, tried changing the name, even copied bitmaps from other scripts to check it, but it keeps telling me I've made a type mismatch..

I'm way further then lost.. The only possible thing I could think of is simba not being able to load more than 5 bitmaps, which wouldn't make much sense to me..

~Annonymus

Ian

2014-09-16 19:04:57

You should post the code

Justin

2014-09-16 19:07:29

Simba can load more than 5 bitmaps at a time, As BMWxi said, you're best bet is to post the code :)

iEatApplez

2014-09-16 19:09:47

Debug:
[Error] C:Blablablabla\AnnonymusFletcherV0.02.simba(56:24): Type mismatch at line 56
Compiling failed.
procedure StartBMPS;
begin
BowstringBitmap:=BitmapFromString(15, 16, 'meJxjYCABMOJFaCC8rAkPwlSPZr' +
'53aj4QIatnRFWGrIsBph6XFgYM9cha4Lrw+BquBaJSUFAEf1ihuQS' +
'PycgqgcZiKkYOEDzGYg03NGMZsVmKK2owpYDmoCG4YqxSuFIIwcRD' +
'NgAAZ71WXQ==');
//This is line 56~
case LogType of
'Normal':
LogBMP:=BitmapFromString(12, 12, 'meJxjYIACRgaGgL71EGSd3GSZWG' +
'8RXwNCMZUM2NTIBBRBlEEQdjUhZTapLUBlEASRZURVA1cGUQmU0g/' +
'IhCBkBRATIHaJO8UDRQyDcoxD803Ci2TCqkAooAjuGE3XKCmPdP/e' +
'NT5tSz0a5wLVmEWVAhUAvaPrmwpH8tGNQMOBajyb50PUSHlnAzUC2' +
'RAENB9ocuDEjT6dK+BqIHZJ+eZDwye+BugYoDm+3au8WxYB1QANQX' +
'M50ElA9UD3ANUArYO4GYsa72wgG2gXUI173WxMc4AIACj4lBo=');

'Oak':
LogBMP:=BitmapFromString(10, 9, 'meJxL7FxhkNzqWjLNtWgyJkrsXJE' +
'IVwBT41IwAYKgUqiCTnm99pntNilNRqnterF1EBEgMgjMNArOMQnL' +
'N40oMo8uBUoBBYEMIAKKQAQtYyus42usk+p1Iso1AnOBhsARUBBI2' +
'qW1Ag2HmAxU45jThYaAZkLcDHJbYhPcYRA3YMoiKwCSAPfZbYo=');

'Willow':
LogBMP:=BitmapFromString(13, 9, 'meJxzzCp2hCHFwEhMJO8bJuMRhEs' +
'NUBaiQMbVV9LRA6LGLiUXIg5EYuZ2QCRp4wJCjh5ABFQJVA9RAxWH' +
'I7gCsBogso5LM4+Ih4qgIbACuPOABgIVw+3FREBZuC/s0wuQ3Y+MH' +
'JECBI8yYkwDigAATs9gIA==');

'Maple':
LogBMP:=BitmapFromString(13, 8, 'meJwzyeozSu/m8ytCQd75nB7ZnK5' +
'pnE5JnPaxnJbBJll9BsmtQHEI4jT1AwqCkE0ECAHVAFU6JUHUQAXh' +
'CCgLUQA0EIg8svVi67TCSqBciC0QBJYFIogtEEuBiuH2YkVAZRBkl' +
'NoOdz+ZyvyKEMrgwYKhBogAPc5VQA==');

'Yew':
LogBMP:=BitmapFromString(12, 9, 'meJyzz2+3ByNOk2BOryQsyDUWpwL' +
'XWBByiuC0DwbJApGBH1TQNZbByAWIOM29QMjaD4SAKiEKIIJwBJEF' +
'GgJEQDU6XiAE4aIhoCwEQexCsg4d6XjZY3oNTY1JMGE1RJgDAGYCS60=');

'Magic':
LogBMP:=BitmapFromString(10, 8, 'meJybv0Zn2mIt08wi8+xS96JqOHL' +
'Nr3DJLQMKAqWACE3cMavYPr0AIospDkEx9e1AhGymR2kdHAGlvMob' +
'geqBJBB5V7XAkW9NO1D77Ts3Ll893z1dDagxtWcqBKV0TQIioF337' +
't+auUxrygItIBsuC1FgXVjz4NHd+Wt05qzQATopvW86sgIAAjdq7A==');
end;
end;

Tried seperating the bowstring BMP and the logBMP in different procedures, still same problem at the bowstring BMP..

This also happens with the knifebmp and I even tried a leather bmp from a tanning script, lol…

Also, proof that I'm not a complete idiot;
var
A:Extended;
x, y, StartTime: Integer;
LogBMP: Integer;
WhatToDo, LogType, KnifeBitmap, BowstringBitmap, CloseButton, BankLocation: String;

Edit;
Thanks for the quick replies

~Annonymus

Justin

2014-09-16 19:16:53

Can you post the whole script? I just made a dummy version and I was able to compile it fine.


program new;

var LogType : String;
BowstringBitmap, LogBMP : Integer;

procedure StartBMPS;
begin
BowstringBitmap:=BitmapFromString(15, 16, 'meJxjYCABMOJFaCC8rAkPwlSPZr' +
'53aj4QIatnRFWGrIsBph6XFgYM9cha4Lrw+BquBaJSUFAEf1ihuQS' +
'PycgqgcZiKkYOEDzGYg03NGMZsVmKK2owpYDmoCG4YqxSuFIIwcRD' +
'NgAAZ71WXQ==');
case LogType of
'Normal':
LogBMP:=BitmapFromString(12, 12, 'meJxjYIACRgaGgL71EGSd3GSZWG' +
'8RXwNCMZUM2NTIBBRBlEEQdjUhZTapLUBlEASRZURVA1cGUQmU0g/' +
'IhCBkBRATIHaJO8UDRQyDcoxD803Ci2TCqkAooAjuGE3XKCmPdP/e' +
'NT5tSz0a5wLVmEWVAhUAvaPrmwpH8tGNQMOBajyb50PUSHlnAzUC2' +
'RAENB9ocuDEjT6dK+BqIHZJ+eZDwye+BugYoDm+3au8WxYB1QANQX' +
'M50ElA9UD3ANUArYO4GYsa72wgG2gXUI173WxMc4AIACj4lBo=');

'Oak':
LogBMP:=BitmapFromString(10, 9, 'meJxL7FxhkNzqWjLNtWgyJkrsXJE' +
'IVwBT41IwAYKgUqiCTnm99pntNilNRqnterF1EBEgMgjMNArOMQnL' +
'N40oMo8uBUoBBYEMIAKKQAQtYyus42usk+p1Iso1AnOBhsARUBBI2' +
'qW1Ag2HmAxU45jThYaAZkLcDHJbYhPcYRA3YMoiKwCSAPfZbYo=');

'Willow':
LogBMP:=BitmapFromString(13, 9, 'meJxzzCp2hCHFwEhMJO8bJuMRhEs' +
'NUBaiQMbVV9LRA6LGLiUXIg5EYuZ2QCRp4wJCjh5ABFQJVA9RAxWH' +
'I7gCsBogso5LM4+Ih4qgIbACuPOABgIVw+3FREBZuC/s0wuQ3Y+MH' +
'JECBI8yYkwDigAATs9gIA==');

'Maple':
LogBMP:=BitmapFromString(13, 8, 'meJwzyeozSu/m8ytCQd75nB7ZnK5' +
'pnE5JnPaxnJbBJll9BsmtQHEI4jT1AwqCkE0ECAHVAFU6JUHUQAXh' +
'CCgLUQA0EIg8svVi67TCSqBciC0QBJYFIogtEEuBiuH2YkVAZRBkl' +
'NoOdz+ZyvyKEMrgwYKhBogAPc5VQA==');

'Yew':
LogBMP:=BitmapFromString(12, 9, 'meJyzz2+3ByNOk2BOryQsyDUWpwL' +
'XWBByiuC0DwbJApGBH1TQNZbByAWIOM29QMjaD4SAKiEKIIJwBJEF' +
'GgJEQDU6XiAE4aIhoCwEQexCsg4d6XjZY3oNTY1JMGE1RJgDAGYCS60=');

'Magic':
LogBMP:=BitmapFromString(10, 8, 'meJybv0Zn2mIt08wi8+xS96JqOHL' +
'Nr3DJLQMKAqWACE3cMavYPr0AIospDkEx9e1AhGymR2kdHAGlvMob' +
'geqBJBB5V7XAkW9NO1D77Ts3Ll893z1dDagxtWcqBKV0TQIioF337' +
't+auUxrygItIBsuC1FgXVjz4NHd+Wt05qzQATopvW86sgIAAjdq7A==');
end;
end;

begin;
LogType := 'Normal';
StartBMPS;
FreeBitMap(LogBMP);
FreeBitMap(BowstringBitmap);
end.

E: Found it, You have 'BowstringBitmap' as a String, It needs to be a Integer

iEatApplez

2014-09-16 19:21:28

(********************************************************)
(*******.________________________________________.*******)
(*******| |*******)
(*******| Annonymus AIO Fletcher V0.02 |*******)
(*******| Annonymus is in no way responsible |*******)
(*******| for any damage to your account |*******)
(*******| |*******)
(*******| USE AT OWN RISK |*******)
(*******|________________________________________|*******)
(********************************************************)
(********************************************************)

// MAKE SURE THAT, IF YOU'RE CUTTING LOGS, HAVE A KNIFE IN YOUR INVENTORY ALREADY!
// MAKE SURE THAT LOGS OR UNSTRUNG BOWS ARE IN FIRST BANK SLOT!
// MAKE SURE THAT, IF YOU'RE STINGING BOWS, BOWSTRINGS ARE IN THE SECOND BANK SLOT!
// I suck, I should totally change this k..
program AnnonymusAIOFletcher;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SRL-OSR/SRL/Reflection/Reflection.simba}

var
A:Extended;
x, y, StartTime: Integer;
LogBMP: Integer;
WhatToDo, LogType, KnifeBitmap, BowstringBitmap, CloseButton, BankLocation: String;

const
CWBANKCHEST = 6316135;
BANKOFRS = 2070783;
VARROCKBANKER = 6045001;

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers (HowManyPlayers);
CurrentPlayer :=0;
WhatToDo:='Cut'; // Cut, String
LogType:='Normal'; // Normal, Oak, Willow, Maple, Yew, Magic
BankLocation:='CastleWars'; //CastleWars, VWest

Players[0].Name :=''; //UserName Login
Players[0].Pass :=''; //Password
Players[0].Nick :=''; //3-4 Letters from Name
Players[0].WorldInfo := [306]; //World Number
Players[0].Active:=True;
end;

procedure StartBMPS;
begin
KnifeBitmap:= BitmapFromString(8, 14, 'meJxjYEABjAwMWVlFQMSAIZ6dUwJ' +
'EaIK5eWUQhCaeX1ABRMjqgYKFhVVABFScnp6PLF5cXAMUB1ra1zcT' +
'LlhaWgcUBypOTc2dN28VsjjQZKAJEyfOYYQJlpc3AE0AWpecnL148' +
'XpGJJMh1k2dtgguyGEZCkQzZy3t6JyybPkmiDhEEC7FCHMesjivRw' +
'6mOLIgEAAAeplCfg==');

BowstringBitmap:=BitmapFromString(15, 16, 'meJxjYCABMOJFaCC8rAkPwlSPZr' +
'53aj4QIatnRFWGrIsBph6XFgYM9cha4Lrw+BquBaJSUFAEf1ihuQS' +
'PycgqgcZiKkYOEDzGYg03NGMZsVmKK2owpYDmoCG4YqxSuFIIwcRD' +
'NgAAZ71WXQ==');

case LogType of
'Normal':
LogBMP:=BitmapFromString(12, 12, 'meJxjYIACRgaGgL71EGSd3GSZWG' +
'8RXwNCMZUM2NTIBBRBlEEQdjUhZTapLUBlEASRZURVA1cGUQmU0g/' +
'IhCBkBRATIHaJO8UDRQyDcoxD803Ci2TCqkAooAjuGE3XKCmPdP/e' +
'NT5tSz0a5wLVmEWVAhUAvaPrmwpH8tGNQMOBajyb50PUSHlnAzUC2' +
'RAENB9ocuDEjT6dK+BqIHZJ+eZDwye+BugYoDm+3au8WxYB1QANQX' +
'M50ElA9UD3ANUArYO4GYsa72wgG2gXUI173WxMc4AIACj4lBo=');

'Oak':
LogBMP:=BitmapFromString(10, 9, 'meJxL7FxhkNzqWjLNtWgyJkrsXJE' +
'IVwBT41IwAYKgUqiCTnm99pntNilNRqnterF1EBEgMgjMNArOMQnL' +
'N40oMo8uBUoBBYEMIAKKQAQtYyus42usk+p1Iso1AnOBhsARUBBI2' +
'qW1Ag2HmAxU45jThYaAZkLcDHJbYhPcYRA3YMoiKwCSAPfZbYo=');

'Willow':
LogBMP:=BitmapFromString(13, 9, 'meJxzzCp2hCHFwEhMJO8bJuMRhEs' +
'NUBaiQMbVV9LRA6LGLiUXIg5EYuZ2QCRp4wJCjh5ABFQJVA9RAxWH' +
'I7gCsBogso5LM4+Ih4qgIbACuPOABgIVw+3FREBZuC/s0wuQ3Y+MH' +
'JECBI8yYkwDigAATs9gIA==');

'Maple':
LogBMP:=BitmapFromString(13, 8, 'meJwzyeozSu/m8ytCQd75nB7ZnK5' +
'pnE5JnPaxnJbBJll9BsmtQHEI4jT1AwqCkE0ECAHVAFU6JUHUQAXh' +
'CCgLUQA0EIg8svVi67TCSqBciC0QBJYFIogtEEuBiuH2YkVAZRBkl' +
'NoOdz+ZyvyKEMrgwYKhBogAPc5VQA==');

'Yew':
LogBMP:=BitmapFromString(12, 9, 'meJyzz2+3ByNOk2BOryQsyDUWpwL' +
'XWBByiuC0DwbJApGBH1TQNZbByAWIOM29QMjaD4SAKiEKIIJwBJEF' +
'GgJEQDU6XiAE4aIhoCwEQexCsg4d6XjZY3oNTY1JMGE1RJgDAGYCS60=');

'Magic':
LogBMP:=BitmapFromString(10, 8, 'meJybv0Zn2mIt08wi8+xS96JqOHL' +
'Nr3DJLQMKAqWACE3cMavYPr0AIospDkEx9e1AhGymR2kdHAGlvMob' +
'geqBJBB5V7XAkW9NO1D77Ts3Ll893z1dDagxtWcqBKV0TQIioF337' +
't+auUxrygItIBsuC1FgXVjz4NHd+Wt05qzQATopvW86sgIAAjdq7A==');
end;
end;

procedure StartScript;
begin
if not LoggedIn then Exit;
GameTab(tab_Inv);
Wait(RandomRange(75, 150));
setangle(SRL_Angle_High);
case BankLocation of
'CastleWars':
MakeCompass('N');
'VWest':
MakeCompass('E');
end
Exit;
end;

// could repeat until(FindColorTolerance(x,y,BANKOFRS,20,10,340,35,5));
procedure OpenTheBank;
begin
if not LoggedIn then Exit;
case BankLocation of
'CastleWars':
if (FindObj(x, y, 'hest', CWBANKCHEST, 5)) then
begin
Writeln('Found the Castle Wars chest colour.. Now checking for Uptext.');
if (IsUpTextMultiCustom(['hest'])) then
begin
WriteLn('Uptext = Bank Chest!');
Clickmouse2(false);
Wait(RandomRange(40,90));
if ChooseOption('Use') then
begin
ChooseOption('Use');
Writeln('Opened bank.');
Wait(randomrange(400,500));
end;
end;
end;
'VWest':
if (FindObj(x, y, 'anker', VARROCKBANKER, 5)) then
begin
Writeln('Found the Varrock banker color.. Now checking for Uptext.');
if (IsUpTextMultiCustom(['anker'])) then
begin
WriteLn('Uptext = Banker!');
Clickmouse2(false);
Wait(RandomRange(40,90));
if ChooseOption('ank Banker') then
begin
ChooseOption('ank Banker');
Writeln('Opened bank.');
Wait(randomrange(300,400));
end;
end;
end;
//temp ends
end;
end;

procedure WithdrawTheStuffs;
begin
if not LoggedIn then Exit;
case WhatToDo of
'Cut':
begin
if FindDeformedBitmapToleranceIn(LogBMP,x,y,70,80,107,117,5,0,false,A) then
begin
Writeln('Found the logs in bank!');
MMouse(x,y,3,3);
ClickMouse2(false);
Wait(RandomRange(30,70));
if ChooseOption('ithdraw-All') then
begin
ChooseOption('ithdraw-All');
Wait(RandomRange(40,90));
end;
end else
begin
Writeln('Could not detect logs in first bank slot. Are they really there?');
TerminateScript;
end;
//temp ends
end;
end;
end;

procedure CutOrStringStuff;
begin
if not LoggedIn then Exit;
case WhatToDo of
'Cut':
begin
if FindDeformedBitmapToleranceIn(LogBMP,x,y,560,205,590,245,5,0,false,A) then
begin
Writeln('Found knife in inventory!');
MMouse(x,y,2,2);
Clickmouse2(false);
Wait(RandomRange(20,45));
end;
if FindDeformedBitmapToleranceIn(LogBMP,x,y,600,210,640,245,5,0,false,A) then
begin
Writeln('Found logs in inventory!');
MMouse(x,y,3,3);
ClickMouse2(false);
Wait(RandomRange(15,30));
end; //more temp ends...
end;
end;
end;





begin
ActivateClient;
DeclarePlayers;
SetupSRL;
SetupReflection;
MouseSpeed := 18; //MouseSpeed
StartBMPS;
LoginPlayer;
StartScript;
MarkTime(StartTime);

repeat
if not LoggedIn then LoginPlayer;
OpenTheBank;
WithdrawTheStuffs;
until(false);
AddOnTerminate('FreeAll');
end.

No hate on the script, it really is at v0.02 for a reason. :p

~Annonymous

Justin

2014-09-16 19:22:23

@Annonymus;

You have 'BowstringBitmap' and 'KnifeBitmap' as a String, they need to be Integer

iEatApplez

2014-09-16 19:24:13

Oh god.. you gotta be joking me.. Tried everything and that seems to be the fail. I love myself…
I actually got stuck on this for 3 days..

Thanks though, thank you so much.

The Mayor

2014-09-16 19:25:27

It would probably be wise to use:


case lowerCase(LogType) of
'normal':
'oak':
//etc
end;

so it will still load the bmp is someone types LogType := 'normal' inseaad of 'Normal'.

Clarity

2014-09-16 19:45:24

If you ever run into the 5 BMP limit again it probably would be easier overall to use DTMs.

iEatApplez

2014-09-16 19:45:54

From: The Mayor
It would probably be wise to use:


case lowerCase(LogType) of
'normal':
'oak':
//etc
end;

so it will still load the bmp is someone types LogType := 'normal' inseaad of 'Normal'.


I actually just did that, but thanks =p