Log in

View Full Version : Help with quick script issue please? :D



BusyBee
11-17-2010, 10:40 PM
Out of context: So I just stumbled upon this program and wow, this is going to be one of the funnest hobbies I have ever had I am hoping, as I imagine the countless things that I can do in all the little games I love and enjoy playing.

I'm reading through the newbie guides and tutorials as you read this most likely as I do wish to learn how to use this program very well and make my own scripts, but some quick help on the issue would be greatly appreciated so I can get to some business to see how good it works ingame.

Ok so I downloaded this script from somewhere and it does not work on my computer resolution I am guessing? the script is in the attachments but is there a easier way to post it so you guys can see it without having to download it?

And this is the error that I get

Entering main loop...
Error: Exception: You passed a wrong xe to a finder function: 785. The client has a width of 666, thus the xe is out of bounds. at line 125
The following bitmaps were not freed: [0, 1, 2, 3, 4, 5, 6, 7]


Edit: This is also line 120 - 129


procedure ScanItem (item : ROTMGItem);
var
x,y : integer;
begin
if FindBitmapToleranceIn(item.Image,x,y,610,500,785,5 95,25) then
begin
GrabItem(item,x,y);
end;
end;

Im just guessing the gaming window is out of place on the screen for the program to run? but not sure? is this a quick fix somebody could point me in the right direction or will I just learn it in the tutorial in a weeks time or so?

O and its a AutoLoot script for the game "Realm of the mad god" Which is a VERY fun addicting little fast paced game. :D

i luffs yeww
11-18-2010, 07:32 AM
"Error: Exception: You passed a wrong xe to a finder function: 785. The client has a width of 666, thus the xe is out of bounds. at line 125"

That error is saying that you're searching for a pixel that isn't part of the client. The client is the active space that Simba is looking in, which is defined by you dragging the crosshair to whatever.

To fix the error, simply change 785 on line 125 to 665 (the area to search in has to be one less pixel than the size of it, as computational numbering starts with 0, thus a 50x50 square is defined as a 49x49 space. So if you want to search in a 50x50 area, xs (x-coordinate start pixel to search is what that stands for (literally "x start")) would be 0, ys (y start) would be 0, xe (x end) would be 49, and ye (y end) would be 49.

After you run it with that change, it will most likely give an error where ye is out of bounds. Simply change it accordingly (it will tell you the end coordinate, and just subtract one from that).

EGM
11-18-2010, 01:10 PM
How about letting Simba grab the client size for you?

procedure ScanItem (item : ROTMGItem);
var
x,y,xe,ye : integer;
begin
GetClientDimensions(xe, ye);
if FindBitmapToleranceIn(item.Image, x, y, 610, 500, xe-1, ye-1, 25) then
GrabItem(item,x,y); //didn't need extra block for single statement.
end;

~EGM