View Full Version : Make a food eater
begginer
01-29-2012, 08:51 PM
How to make a simple one. That eats, lobsters. Just eating by text not color or can be eating by color too. Any suggestion.
Shuttleu
01-29-2012, 08:54 PM
so what, this would be used while you are playing legit?
~shut
begginer
01-29-2012, 08:58 PM
I am making a killing script. I need to eat something :)
Shuttleu
01-29-2012, 09:04 PM
var
MMColor: string;
GetMMLevels('hp', MMColor);
if (MMColor = 'Red') then
repeat
//eat something
GetMMLevels('hp', MMColor)
until((MMColor = 'Green') or {find no food})
~shut
begginer
01-29-2012, 09:09 PM
Error] (90:3): Duplicate identifier 'GetMMLevels' at line 89
What's wrong
Shuttleu
01-29-2012, 09:13 PM
Error] (90:3): Duplicate identifier 'GetMMLevels' at line 89
What's wrong
procedure EatIfLow;
var
MMColor: string;
begin
GetMMLevels('hp', MMColor);
if (MMColor = 'Red') then
repeat
//eat something
GetMMLevels('hp', MMColor)
until((MMColor = 'Green') or {find no food})
end;
~shut
begginer
01-29-2012, 09:24 PM
thanks, but what's wrong here
begin
GetMMLevels('hp', MMColor);
if (MMColor = 'Red') then
repeat
begin
InvMouse(I, 3);
if IsUpText('Eat Lobster') then
begin
ClickMouse2(True);
Wait(RandomRange(350, 525));
Exit;
end else
Continue;
end;
This error : ** Warning in InvMouse: Inventory slot #0 is not a valid slot**
Shuttleu
01-29-2012, 09:27 PM
thanks, but what's wrong here
begin
GetMMLevels('hp', MMColor);
if (MMColor = 'Red') then
repeat
begin
InvMouse(I, 3);
if IsUpText('Eat Lobster') then
begin
ClickMouse2(True);
Wait(RandomRange(350, 525));
Exit;
end else
Continue;
end;
This error : ** Warning in InvMouse: Inventory slot #0 is not a valid slot**
post the whole function
how do you search for the lobster
~shut
begginer
01-29-2012, 09:34 PM
procedure EatIfLow;
var
MMColor: string;
I: Integer;
begin
GetMMLevels('hp', MMColor);
if (MMColor = 'Red') then
repeat
begin
InvMouse(I, 3);
if IsUpText('Eat Lobster') then
begin
ClickMouse2(True);
Wait(RandomRange(350, 525));
Exit;
end else
Continue;
end;
GetMMLevels('hp', MMColor)
until((MMColor = 'Green'))
end;
Shuttleu
01-29-2012, 09:40 PM
procedure EatIfLow;
var
MMColor: string;
I: Integer;
begin
GetMMLevels('hp', MMColor);
if (MMColor = 'Red') then
repeat
begin
InvMouse(I, 3);
if IsUpText('Eat Lobster') then
begin
ClickMouse2(True);
Wait(RandomRange(350, 525));
Exit;
end else
Continue;
end;
GetMMLevels('hp', MMColor)
until((MMColor = 'Green'))
end;
you never search the inventory for the lobster
something like this
procedure EatIfLow;
var
MMColor: string;
I: Integer;
begin
GetMMLevels('hp', MMColor);
if (MMColor = 'Red') then
repeat
if FindDTM({dtm}, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
InvMouse(CoordsToItem(x, y), 3);
if WaitUpText('Eat Lobster', 1000) then
begin
ClickMouse2(True);
Wait(RandomRange(350, 525));
end;
end else
Break;
GetMMLevels('hp', MMColor)
until((MMColor = 'Green'))
end;
~shut
kitchenrange
01-30-2012, 06:15 AM
What he was trying to do was without the dtms and he forgot to
for i := 1 to 28 do
He should definitely go dtm route though.
begginer
01-30-2012, 10:36 PM
procedure EatIfLow;
var
MMColor: string;
x, y, Lobster: Integer;
begin
Lobster := DTMFromString('mggAAAHicY2NgYMhhYmAoAuIyIM4G4iQgjg Xi2YwMDBOBeBIQrwDiZYwQsU2RUgxLgyQYNkRIMmyNlgKawMTQ 4ybCgAsw4sAQAADyqwur');
end;
begin
GetMMLevels('hp', MMColor);
if (MMColor = 'Red') then
repeat
if FindDTM(Lobster, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
InvMouse(CoordsToItem(x, y), 3);
if WaitUpText('Eat Lobster', 1000) then
begin
ClickMouse2(True);
Wait(RandomRange(350, 525));
end;
end else
Break;
GetMMLevels('hp', MMColor)
until((MMColor = 'Green'))
end;
This is error [Error] (93:21): Unknown identifier 'MMColor' at line 92
Compiling failed.
kitchenrange
01-30-2012, 11:01 PM
take out the "end;" right below your "DTMFromString" and put it at the very end on the last line by itself.
it looks like you end the procedure there and then start on something else...
Also, you should look into turning that into a function that returns a boolean. THis way you can say something like:
if not(EatIfLow) then Logout
see where I'm going?
begginer
01-31-2012, 08:04 AM
The following DTMs were not freed: [2]
Does that mean, I didn't get DTM properly ?
NickMystre
01-31-2012, 08:06 AM
Simba is letting you know that it free'd the DTM's for you. Your script either does not have the instruction 'FreeDTM' or it crashed.
begginer
01-31-2012, 08:09 AM
If you look at the script (It's on my last post) you can see what's the problem.
NickMystre
01-31-2012, 08:21 AM
Are you talking about this ...
This is error [Error] (93:21): Unknown identifier 'MMColor' at line 92
Compiling failed.
begginer
01-31-2012, 08:27 AM
procedure EatIfLow;
var
MMColor: string;
x, y, Lobster: Integer;
begin
Lobster := DTMFromString('mggAAAHicY2NgYMhhYmAoAuIyIM4G4iQgjg Xi2YwMDBOBeBIQrwDiZYwQsU2RUgxLgyQYNkRIMmyNlgKawMTQ 4ybCgAsw4sAQAADyqwur');
begin
GetMMLevels('hp', MMColor);
if (MMColor = 'Red') then
repeat
if FindDTM(Lobster, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
InvMouse(CoordsToItem(x, y), 3);
if WaitUpText('Eat Lobster', 1000) then
begin
ClickMouse2(True);
Wait(RandomRange(350, 525));
end;
end else
Break;
GetMMLevels('hp', MMColor)
until((MMColor = 'Green'))
end;
end;
This is the script. I get this error The following DTMs were not freed: [2]
NickMystre
01-31-2012, 08:35 AM
My guess is that while you have declared 'MMColor' no value is ever assigned to it. That is why your script terminates itself - and then Simba then tells you that it freed DTMs still left in memory.
Also - you do realise that this is just a procedure you have posted and not the whole program. (Sorry if you knew this already!)
How does that sound ? :)
EDIT: Just a thought - is MMColor perhaps a global variable ?
Nataurs
01-31-2012, 09:20 AM
procedure EatIfLow;
var
MMColor: string;
x, y, Lobster: Integer;
begin
Lobster := DTMFromString('mggAAAHicY2NgYMhhYmAoAuIyIM4G4iQgjg Xi2YwMDBOBeBIQrwDiZYwQsU2RUgxLgyQYNkRIMmyNlgKawMTQ 4ybCgAsw4sAQAADyqwur');
begin
GetMMLevels('hp', MMColor);
if (MMColor = 'Red') then
repeat
if FindDTM(Lobster, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
InvMouse(CoordsToItem(x, y), 3);
if WaitUpText('Eat Lobster', 1000) then
begin
ClickMouse2(True);
Wait(RandomRange(350, 525));
end;
end else
Break;
GetMMLevels('hp', MMColor)
until((MMColor = 'Green'))
end;
end;
This is the script. I get this error The following DTMs were not freed: [2]
Add 'FreeDTM(Lobster);' before the last end
DemiseScythe
01-31-2012, 10:45 AM
Interesting set of functions =)
Wish I wasn't so hard headed lol, kind of built my own but this looks like it will work just fine. Gl.
Tickyy
01-31-2012, 10:56 AM
Function LowHPLetsEat(What: String): Boolean;
var
I, x, y: Integer;
begin
Result := (HPPercent < 50) and (LoggedIn); // 50 is hp percentage, change that if you wish it any lower or higher
If(not(Result)) then
Exit;
if Result then
If InvEmpty then // If no more food failsafe, you need another failsafe in case there's no food named lobster for ex.
begin
Logout;
TerminateScript;
end
else
for i := 1 to 28 do
begin
InvMouse(I, 3);
Wait(RandomRange(250, 300));
if WaitUpText(What, RandomRange(250, 400)) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Exit;
end else
Continue;
end;
end;
DemiseScythe
01-31-2012, 11:00 AM
What if the script loots something Ticky?
Tickyy
01-31-2012, 03:07 PM
What if the script loots something Ticky?
It just hovers it, looking for the uptext, if uptext found... it clicks. That's it.
begginer
02-06-2012, 10:00 PM
Function LowHPLetsEat: Boolean;
var
I, x, y: Integer;
begin
Result := (HPPercent < 50) and (LoggedIn); // 50 is hp percentage, change that if you wish it any lower or higher
If(not(Result)) then
Exit;
if Result then
If InvEmpty then // If no more food failsafe, you need another failsafe in case there's no food named lobster for ex.
begin
Logout;
TerminateScript;
end
else
for i := 1 to 28 do
begin
InvMouse(I, 3);
Wait(RandomRange(250, 300));
if WaitUpText('Lobster', RandomRange(250, 400)) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Exit;
end else
Continue;
end;
end;
Will this work for lobster?
darkmoon500
02-06-2012, 11:08 PM
Is it working ? I need the same thing but only for sharks, need to add it on my Bandit script
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.