SRL Archive - SRL Bugs

InvMouse returns true when it shouldn't


footballjds

2012-03-20 14:40:35

InvMouse will return true as long as the param you pass it is 1-28. it says "idgaf" if there is actually something to click… It will click even if nothing is their. If we want that(no IDEA why) then i want mouseItem back!!!

Home

2012-03-20 14:43:57

From: footballjds
InvMouse will return true as long as the param you pass it is 1-28 and it can get to the inventory tab. it says "idgaf" if there is actually something to click… It will click even if nothing is their. If we want that(no IDEA why) then i want mouseItem back!!!


We have MouseItem…

But in your case just do. If ExistsItem(2) then InvMouse(2….);


~Home

Kyle Undefined

2012-03-20 14:44:47

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.

footballjds

2012-03-20 15:23:57

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;

Kyle Undefined

2012-03-20 16:54:27

It returns true because it's doing what it said, it's mouse-ing the inventory slot. It will return false if the mouse or slot arguments aren't correct.

The name suits what it does perfectly.

footballjds

2012-03-20 16:56:33

From: Kyle Undefined
It returns true because it's doing what it said, it's mouse-ing the inventory slot. It will return false if the mouse or slot arguments aren't correct.

The name suits what it does perfectly.


don't ignore the rest of what i said kyle ;)
talk about MouseItem…

Coh3n

2012-03-22 01:00:13

Kyle's right about InvMouse, and when did MouseItem ever check if there was an item in that slot? I agree that it should check, but really? You're making a huge deal over this when you could just add one line of code to your script.

MouseItem is a completely pointless function as it is, actually. It's just InvMouse with a different name. I'll add an if (ExistsItem(I)) then to MMouseItem and MouseItem.