SRL Archive - OSR Help

For To Do Statements


King

2012-12-05 20:33:20

I am working on a enchanter for rings of dueling (only really profitable one right now) I am wondering how I would create a For To Do Statement to enchant all of the inventory.

This is what I have so far

Function Enchant:Boolean;
begin
if InvFull then
begin
for i:= 0 to 27 do
begin
SendKeys('1', 5, 5);
InvMouse(2,1);
GetXPBarTotal
repeat
wait(50);
until(GetXPBarTotal-GetXPBarTotal=37);
end;
end;
end;

I want it to Send the key '1' to activate my spell on the action bar, then I want it to click the Inventory slots in order and then wait until the XP total is 37 more than it was before (how much exp is given from the spell). Is this right? Any ideas on a better way to do this?

DannyRS

2012-12-05 20:36:17

Take a look at my eoc superheater over in my requests thread, cant link atm on phone, but you can probably use my procedure to do what you want with the action bar atleast, as for all the inv slots, you'll have to make a loop,

If i remember the horizontal inv slots are 42 pixels apart, vertical i cant recall however,

You want a for loop inside a for loop, to repeat the first loop 4 times then again on the next row etc etc, i cant write it for you as i have no idea of the syntax for pascal, i only know it in C# and simular :D


for (int y = NumberOfRow; y < NumOfInvRows; y++;)
{
for (int x = NumberOfCol; x < NumOfInvCols; x++;)
{
ActionBarThing;
Click inv spot(x,y);
x++;
}
y++;
}

Rezozo

2012-12-05 20:39:57

If you have to click each one, change the invMouse to: InvMouse(i+1, 1);

This would follow the for loop in clicking each inventory spot after the first one.
~Rez

Sin

2012-12-05 20:44:01

http://villavu.com/forum/showthread.php?t=77658

y u no search

King

2012-12-05 20:46:52

From: Shay
http://villavu.com/forum/showthread.php?t=77658

y u no search


I must have skimmed over that! Dang Shay, thankyou!

Sin

2012-12-05 20:55:12

Yvw :)

Roflme

2012-12-06 07:12:11

And for your xp detection, I'd suggest declaring something as GetXpBarTotal


XpFirst := GetXPBarTotal;

Since GetXPBarTotal - GetXPBarTotal will = 0. You need to GetXPBarTotal from an earlier XP amount and set that to a variable. Then you can continue to call GetXPBarTotal until it has increased


And personally, I'd declare that before you click on your Inv.


Function Enchant:Boolean;
var
XPFirst, i: Integer;
begin
if InvFull then
begin
for i:= 1 to 28 do
if ExistsItem(i) then
begin
SendKeys('1', 5, 5);
XPFirst := GetXPBarTotal;
InvMouse(i,1);
while (XPFirst = GetXPBarTotal) do
Wait(50);
end;
end;
end;

Try that out :p I haven't tested that.

If that doesn't work just play around with it :)

YoHoJo

2012-12-06 07:15:00

For Learning To Your Brain Do Read Tutorials :) <3

King

2012-12-06 07:20:42

I read some more, and that's funny YoHoJo XD script has been released, it is in the money money making section with minor anti-leech. I'll be gone until Friday, so I'll add anti-ban and multiplayer when I get back! Thanks for all th e help guys!