Tomnolan
2013-04-29 15:19:04
So basically I'm just learning to script in Simba. I'm currently creating a few small scripts for some simple, mouse only flash games.
However, I'm having trouble with one of my scripts.
The game (/begamer.com/flash-game/22600/monkey-dinner) consists of seating monkeys for food.. You click a monkey in the queue, then click on one of 3 empty seats (or an empty one out of the three).
So for this i created a procedure that uses colorfind to locate a monkey that is in the queue, and then a procedure that would seat them (also using colorfind, it would search for a brown color on the stool that IS vissible when a monkey ISNT sitting down). however, my script will select the monkey in the queue but will not seat it. the script does nothing after selecting a monkey in the queue.
Could some one have a look please? Would be greatly appreciated
However, I'm having trouble with one of my scripts.
The game (/begamer.com/flash-game/22600/monkey-dinner) consists of seating monkeys for food.. You click a monkey in the queue, then click on one of 3 empty seats (or an empty one out of the three).
So for this i created a procedure that uses colorfind to locate a monkey that is in the queue, and then a procedure that would seat them (also using colorfind, it would search for a brown color on the stool that IS vissible when a monkey ISNT sitting down). however, my script will select the monkey in the queue but will not seat it. the script does nothing after selecting a monkey in the queue.
program MonkeyGame;
procedure SelectingMonkey; // Uses colorfind to Locate a monkey in the queue.
var x, y: integer;
Begin;
if findcolor (x, y, 2913210, 281, 363, 303, 455) then // Finds monkey in queue
Begin
MoveMouse (x, y);
ClickMouse (x, y, 1); // moves mouse to bear and selects him.
end;
end;
Procedure SelectingTable;
var x, y: integer;
Begin;
if findcolor (x, y, 7066362, 729, 358, 738, 401) then // searches for the brown colour on the furthest away stool that
// is vissible when the monkey isnt sitting there (ie when the seat is vacant)
Begin;
MoveMouse (645, 223);
ClickMouse (645, 223, 1);//if the seat is vacant, the stool is selected.
end
else if not findcolor (x, y, 7066362, 729, 358, 738, 401) then //if not vaccant then...
if findcolor (x, y, 9232379, 595, 454, 603, 486) then
Begin; //same description as above but for each stool.
MoveMouse (x, y);
ClickMouse (x, y, 1);
End
else if not findcolor (x, y, 9232379, 595, 454, 603, 486) then
if findcolor (x, y, 5880557, 459, 565, 472, 593) then
Begin;
MoveMouse (x, y);
ClickMouse (x, y, 1);
End;
if not findcolor (x, y, 5880557, 459, 565, 472, 593)then
SelectingTable; // if no free seat is found, then the procedure is repeated.
End;
begin;
Repeat
SelectingMonkey;
wait (500); //This should look for a monkey in the queue untill a monkey shows up.
SelectingTable; //and then takes it to a table.
until (True)
repeat
SelectingMonkey; // This should carry out the two procedures but the Selectingtables
wait(500) // seems to do nothing.
SelectingTable;
until (false);
end.Could some one have a look please? Would be greatly appreciated