SRL Archive - OSR Help

Help with eating!


Im fkn rare

2013-03-01 21:15:56

Right now I'm using TrollFighter, written by wthomas. He has some anti-leech, but I don't think it's anti-leech. Is there a method for eating in the P07 Includes?

Here is the code he uses for eating:

Procedure eatFood;
Var i:integer;
Begin
Repeat
Inc(foodslot);
Writeln('trying to eat foods troll style');
Wait(300);
Until P07_UseInvItem(foodslot,'Eat') Or (foodslot>28);
//NB this procedure ^^ is an easily modified version of P07_UseInvItem()
end;

P07_UseInvItem doesn't exist, so how can I incorporate existing methods to eat food?

I have found:
If P07_ItemExists(1) Then DoSomething();

I need to figure out how to click that inventory space.

Runehack123

2013-03-01 21:34:17

If you don't know how to click on an object in your inventory I recommend some beginner's tutorials e.g.
http://www.youtube.com/watch?v=dZGOIqFocpE
or have a read in the forums.
Find the object..move mouse to it..click it. It's that simple. DTM or bitmap will be easy/fast to make for this.

blitzandkill

2013-03-01 22:16:27

Procedure eatFood;
Var i:integer;
Begin
If P07_FindObjCustom(x, y, ['Eat', 'Trout'], [7172489], 5) Then
ClickMouse2(mouse_left);
end;

this would find the color of cooked trout and click on it.

hope this helps

Im fkn rare

2013-03-01 22:20:08

From: Runehack123
If you don't know how to click on an object in your inventory I recommend some beginner's tutorials e.g.
http://www.youtube.com/watch?v=dZGOIqFocpE
or have a read in the forums.
Find the object..move mouse to it..click it. It's that simple. DTM or bitmap will be easy/fast to make for this.


From: blitzandkill
Procedure eatFood;
Var i:integer;
Begin
If P07_FindObjCustom(x, y, ['Eat', 'Trout'], [7172489], 5) Then
ClickMouse2(mouse_left);
end;

this would find the color of cooked trout and click on it.

hope this helps


Thank you both, I'm working on getting into writing scripts!

Im fkn rare

2013-03-01 22:27:08

I'm receiving this error now when I run any script:

[Error] C:\Simba\Includes\Srl\SRL-007/SRL/core/chat.simba(804:69): Unknown identifier 'CharsNPC07' at line 803