SRL Archive - SRL Archives

Inventory Mouse Functions


Pwnd

2006-04-15 15:36:25

IsInvItem will move the mouse to the slot, check to see if the item is there and then return true or false.
MouseInvItem will do what IsInvItem does and then decides to click it left or right.

function IsInvItem(InvItem: string; Slot: integer): boolean;
begin
MMouseItem(Slot);
if(IsUpText('Use ' + InvItem))then
begin
Result:= True;
end else
Result:= False;
end;

function MouseInvItem(InvItem: string; Slot: integer; Click: boolean): boolean;
begin
if(IsInvItem(InvItem, Slot))then
begin
MouseItem(Slot, Click);
Result:= True;
end else
Result:= False;
end;
This is only appropriate for some items knowing that some items don't have "Use" as thier first option.

phantombmx

2006-04-15 17:31:17

coolio! also you could incorporate the isuptext to what a scripter can put in.. pretty much just add a little part like this :D

function IsInvItem(Action, InvItem: string; Slot: integer): boolean;
begin
MMouseItem(Slot);
if(IsUpText(Action + ' ' + InvItem))then
begin
Result:= True;
end else
Result:= False;
end;

function MouseInvItem(Action, InvItem: string; Slot: integer; Click: boolean): boolean;
begin
if(IsInvItem(Action, InvItem, Slot))then
begin
MouseItem(Slot, Click);
Result:= True;
end else
Result:= False;
end;

i know its somethin simple but you could use it like this..
if(MouseInvItem('Blow Up', 'Potato', 4, true))then
writeln('you blew it up!')

that way you dont need to limit it to 'Use'.. lol blow up potato.. what a game that would be

Pwnd

2006-04-15 17:43:27

Actually, I was thinking about that.

Thanks ;)

XxKanexX

2006-04-15 19:18:41

Woot for Pwndeh ;)

Tnx for sharing ;D

Pwnd

2006-04-15 19:20:16

From: XxKanexX
Woot for Pwndeh ;)

Tnx for sharing ;D
Took five seconds, pulled it out of my ass because I was bored.

No problem for sharing.

I also ran out of ideas.