From: Kyle Undefined
InvMouse shouldn't check if there is an item in that slot or not, it's job is to mouse that slot. The script should check if something is there.
MouseItem is still there.
what the heck is the point in a function that ALWAYS returns true?
(unless you give it a bad click var or your item isn't 1-28) IMHO the only way it will return false is if the scripter has a logic error and tells it to click an inv slot that doesn't exist or tells it to do something aside from move, rightClick, leftClick.
From: Home
We have MouseItem…
~Home
no, we don't:
procedure MouseItem(I: Integer; button: Integer);
begin
InvMouse(i, button);
end;
mouse item doesn't do jack sh$%$… MouseItem should DEFINITELY check if there's an item there… don't you agree? After all the name of the procedure is MouseItem not MouseInvSlot…
here is InvMouse, always returning true…
Why would we check the invSlot and Action but not check if there's something there? lol'd…
If you don't want invMouse to check for an item then restore MouseItem back to what it was long before….
function InvMouse(InvSlot, Action: Byte) : boolean;
var
TB: TBox;
CurrPT : TPoint;
begin
result := false;
if (not InRange(Action, 0, 3)) then
begin
srl_Warn('InvMouse', 'Action #' + IntToStr(Action) + ' is not a valid action', warn_AllVersions);
Exit;
end;
if (not InRange(InvSlot, 1, 28)) then
begin
srl_Warn('InvMouse', 'Inventory slot #' + IntToStr(InvSlot) + ' is not a valid slot', warn_AllVersions);
Exit;
end;
GameTab(tab_inv);
Result := true;//<--- wtf?
TB := InvBox(InvSlot);
GetMousePos(CurrPT.x,CurrPT.y);
if PointInBox(CurrPT,TB) then
MouseBox(Max(CurrPT.x-random(2),TB.x1),Max(CurrPT.y-random(2),TB.y1),
Min(CurrPT.x+random(2),TB.x2),Min(CurrPT.y+random(2),TB.y2),Action) //LOL Pro-human much!
else
MouseBox(TB.X1, TB.Y1, TB.X2, TB.Y2, Action);
end;