View Full Version : Bitmaps not working?
Hmm i'm currently making a script which uses bit maps , been a LONG while since I scripted, and my script can't seem to find any of my bit maps, it found them once and then they disapear, I tried setting my tolerance all the way up to 70 and nothing, Ive been out of the scripting game for almost 4 months and I heard there was some update, anyone know what I need to do to make my bit maps work again?
Program New;
{.include SRL/SRL.scar}
var tele2,tele22,XG,YG: Integer;
//-----------------------------------------------------------------//
Procedure LoadBMPs;
begin
tele2 := BitmapFromString(16, 16, 'z78DAC594C10EC42008' +
'447F495765DB632BDBFFFFA46DC265920906B79BD6C31C087 9A38' +
'0A4F4FCC99A341D9E5E676A3F8F7A3AEB15618EBD66C9ADAC 87C8' +
'4B5A2DD9B4C83BD78FC5E32ECCAF65D126C641178CB00BF39 96C3' +
'7343E2A9331EEB9209FC9186132BB8FF95899BD6F7D53E6A3 AFE5' +
'60BEE9986F1AE7637EE4FE5E2FB83EC89CED32F2BD57303F3 E9FA' +
'838F95CEDEBBF0C2BFC1BF99EFDF3DFFDF9058BF557DD');
tele22 := BitmapFromString(17, 16, 'z78DACD94411283200' +
'C45AF14A5A05D5A42EE7FA42261919934364817CDE28F139C F700' +
'11807FA9050181ACFC151F732DB4F29ED143A67D0BEB53A63 4CEF' +
'3A525C10E5B18758D5A624C297E705916EEF7370B95259C09 45EF' +
'8C4CB6F85DDDC2FC4C19568A1401B01680A469B2E5322DCC6 F59B' +
'054FEB93DB6C5CA6B4B7F6CF3673E771E29A410756A3EF7BF ACA5' +
'8D7283D3FF5D24DF7306F814BDF2910F339923D7E5E1DF3BC 99AC' +
'F73F0FF9BD746BD7B7EFEA84B92E76FCEF93BF90D6F6C60C5 ');
End;
Procedure travel ;
begin
if (FindBitmapToleranceIn(tele2,x,y,546,1,745,163,70) ) then
begin
Mouse(x, y, 1, 1, true);
end else
Writeln('Cant find the idiot ')
end;
Procedure travel2 ;
begin
if (FindBitmapToleranceIn(tele22,x,y,546,1,745,163,70 )) then
begin
Mouse(x, y, 1, 1, true);;
end else
Writeln('Cant see the transport icon.');
end;
//Main loop
begin
LoadBMPs;
Travel;
travel2;
End.
Starblaster100
12-16-2006, 11:46 PM
Bitmaps have to be exact for them to return true.
If they change slightly, then you have a problem.
Your pics are of Symbols, and they are very specific. Symbols are always changing, rotating and people are always walking over them, which will cause only a few pixels to change. This will cause your bitmap to return false.
If you want to find th symbols, i suggest using the SRL functions FindSymbol etc. found in Symbol.scar
They use the Functions FindDeformedBitmapToleranceIn, if you want to create your own.
Hope that Helps
Star
Well if you are using SRL then I would recommend you use Symbol.Scar in the Core folder.
Me and Fakawi have included almost all of the symbols including the ones you are probably trying trying to find.
Edit:
I just looked at your symbols, and yes they are included in Symbol.SCAR, so have a look.
Bye deh wait, that's not me. He's been using my account since I CBA to look here anymore :]
Starblaster100
12-17-2006, 12:36 AM
? eh what?
WT-Fakawi
12-17-2006, 12:48 AM
Pwnd, please explain.
(7:09 PM) Pwnd (Pwnds.info: That's not me, btw :]
(7:09 PM) Bebe: who is it?
(7:09 PM) Pwnd (Pwnds.info: Thanatos or something
(7:09 PM) Bebe: wtf?
(7:10 PM) Bebe: I thought you wern't that nubbish
(7:10 PM) Pwnd (Pwnds.info: Lelz
That should explain it.
Someone else has been using his account.
Pwnd aka Rob is not nubbish bebe,
I am thanatos920, used to be on srl and scar forums a lot, but with the change from kaitnieks , to villavu, to vill-reborn, I really don't feel like re registering over and over, rob is teaching me how to script, since he was one of my favorite scripters back when he was scripting (i first got inspired by his flawless fletching script.), since he stopped scripting, he hasn't been active here nor on any scripting forums other than his own site. We couldnt figure out how to fix my script so I used his account to post here. I cannot be active on villu forums right now, so there was no point in me registering a new account and being called a noob, and with pwnds rep it was easier to get my quiestion answered, I will use the symbol.scar and see if i cannot get this to work. And I am sorry for the deceit, but I guess you'll be seeing a bit more from me (Thanatos), on pwnds account if i need help. I am NOT a leecher, and I will be releasing scripts here, just as of now I have nothing to contribute, therefor no reason to join. When i have something to give the community I will sign up again.
Thanks for the info.
Thanatos.
Pwnd aka Rob is nto nubbish bebe,
I am thanatos920, used to be on srl and scar forums a lot, but with the change from kaitnieks , to villavu, to vill-reborn, I really don't feel like re registering over and over, rob is teaching me how to script, since he was one of my favorite scripters back when he was scripting (i first got inspired by his flawless fletching script.), since he stopped scripting, he hasn't been active here nor on any scripting forums other than his own site. We couldnt figure out how to fix my script so I used his account to post here. I cannot be active on villu forums right now, so there was no point in me registering a new account and being called a noob, and with pwnds rep it was easier to get my quiestion answered, I will use the symbol.scar and see if i cannot get this to work. And I am sorry for the deceit, but I guess you'll be seeing a bit more from me (Thanatos), on pwnds account if i need help. I am NOT a leecher, and I will be releasing scripts here, just as of now I have nothing to contribute, therefor no reason to join. When i have something to give the community I will sign up again.
Thanks for the info.
Thanatos.
I know Pwnd is not a nub at scripting, me and him tutored each other on how to script. I have been scripting with Pwnd since I first began about 1 1/2 + years ago (Lol, me and Bobert can't agree when we first started cheating, I say 1 1/2 and he says 2+)
Didn't say you said he was noobish at scripting, you called him noobish for allowing me access to his account. Anyways this is becoming spam, my question was answered, we can debate the issue of pwnds account via PM.
Naw, I don't care anymore.... :p
Lol fair enough, in which case I have another noobish question for you, say there are two transportation icons next to each other, but I only want one of them, how do i get my scar script to distinguish between the two and only click the one I want?
At the moment I am using this
Procedure walktotransport;
begin
Timedwait(3000,1000);
if findsymbol(x,y,'transportation') then
begin
Mouse(x,y,1,1,true);
end else
writeln('cant find transport icon');
end;
this will work somewhat if i decrease the wait time, however if for some reason my character goes to far towards the first symbol and sees the second one on his minimap, he winds up clicking them in a 50/50 ratio. How would i rectify this?
Oh and now that I think of it, since rob doesnt seem to be answering his msn (no wonder I've been badgering him with questions for the past three days, thank you so much for your patients and help rob), I cant seem to get my scar to find or click on the npc by the transport Icon, and i am not sure how I would go about doing that.Right now I am attempting to use the following code, but it doesnt work, any suggestions?
Procedure npc1;
begin
TimedWait(3000,1500); if findobjspiral(x,y,1000,'NpcsNameHere') then
begin
ChanceWait(1000); Mouse(x,y,1,1,false);
end else
writeln('cant find NPC');
end;
sorry if my questions are overly noobish, this is technically my first script lol.
And in comparison I must thank you guys for the bitmap commands, it works getting to the transport icon now :), quite helpful actually. Heres what my script currently looks like, Well without a few things purposely left out.
//Thana's Script//
//Scripted using the latest version of SRL//
//Download it from villu-reborn.com//
Program New;
{.include SRL/SRL.scar}
var XG,YG: Integer;
//---------------------------------------------------------------------------//
Procedure Walktotransport;
Begin
if findsymbol(x,y,'clothes shop') then
begin
Mouse(x,y,1,1,true);
end else
Writeln('cant find clothes shop');
end;
Procedure walktotransporttwo;
begin
Timedwait(3000,1000);
if findsymbol(x,y,'transportation') then
begin
Mouse(x,y,1,1,true);
end else
writeln('cant find transport icon');
end;
Procedure rightclicknpc1;
begin
TimedWait(3000,1500); if findobjspiral(x,y,1000,'NpcsNameHere') then
begin
ChanceWait(1000); Mouse(x,y,1,1,false);
end else
writeln('cant find NPC');
end;
//Main Loop//
begin
Walktotransport;
walktotransporttwo;
rightclicknpc1;
End.
things i need to improve could be improved? answers to questions?post away please.
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.