Narcle
2007-11-02 13:36:53
I've posted one like this before, but this is a BIG improvement.
I changed the istextup to a array, making this way more handy.
Added a is/is-not text up to it.
I also turn it to report a number of how many times its done the action instead of true/false, making it have many more applications.
istextup -Array of names to look for (or not look for)
option -option to choose (if false-leftclick doesn't do anything)
leftclick -left/right click common thing
IsUp -If the text is up or is not up, what this changes is if to look for that text or not to look for it (if 'not' will perform action not with that text).
inv1, inv2 -look from inv1 to inv2 pretty simple
waitfor -how long to wait after click has been made
times -how many times you want it to perform action on item (28 would be full inventory for say burying bones)
I changed the istextup to a array, making this way more handy.
Added a is/is-not text up to it.
I also turn it to report a number of how many times its done the action instead of true/false, making it have many more applications.
function MouseInvTextCustom(istextup: TStringArray; option:string; leftclick, IsUp: Boolean; inv1, inv2, waitfor, times:integer): integer; //by Narcle
var
i,x,y:integer;
begin
gametab(4);
result := 0;
for i := inv1 to inv2 do
if (ExistsItem(i)) then
begin
MMouseItem(i);
GetMousePos(x, y);
wait(100+random(50));
if IsUp then if (IsUpTextMultiCustom(istextup)) then
begin
if (leftclick = true) then
begin
Mouse(x,y,5,5,true)
result := result+1;
end else
begin
Mouse(x,y,5,5,false);
if Chooseoption(option) then result := result+1;
end;
end;
if not(IsUp) then if not(IsUpTextMultiCustom(istextup)) then
begin
if (leftclick = true) then
begin
Mouse(x,y,5,5,true)
result := result+1;
end else
begin
Mouse(x,y,5,5,false);
if Chooseoption(option) then result := result+1;
end;
end;
wait(waitfor+random(100));
if (result = times) then exit;
end;
end
//Example:
MouseInvTextCustom(['ranarr','rune','teel'], 'rop', false, false, 1, 28, 300, 28)
//this will look for names not in array and drop them, up to 28 times (fullinv)istextup -Array of names to look for (or not look for)
option -option to choose (if false-leftclick doesn't do anything)
leftclick -left/right click common thing
IsUp -If the text is up or is not up, what this changes is if to look for that text or not to look for it (if 'not' will perform action not with that text).
inv1, inv2 -look from inv1 to inv2 pretty simple
waitfor -how long to wait after click has been made
times -how many times you want it to perform action on item (28 would be full inventory for say burying bones)