PDA

View Full Version : My own include!



Floor66
02-11-2008, 04:36 PM
Sorry if this has already been made, but i just wanted to test my skillz (:p).

Its called 'InvFinds.scar'
{************************************************* ******************************
Check for the faulty rod (misxster05, THANKS!)
************************************************** ******************************}

Function CheckRod(Var slot: Integer): Boolean;
Var
i: Integer;

Begin
For i:= 1 To 4 Do
Begin
If(ExistsItem(i)) Then
Begin
MMouseItem(i);
If(IsUpText('ishing rod')) and IsUpText('ait') Then
Begin
Result:= True;
slot:= i;
Exit;
End;
End;
End;
End;

{************************************************* ******************************
Check for a faulty harpoon (misxster05, THANKS!)
************************************************** ******************************}

Function CheckHarpoon(Var slot: Integer): Boolean;
Var
i: Integer;

Begin
For i:= 1 To 4 Do
Begin
If(ExistsItem(i)) Then
Begin
MMouseItem(i);
If(IsUpText('arpoon')) Then
Begin
Result:= True;
slot:= i;
Exit;
End;
End;
End;
End;

{************************************************* ******************************
Check for a faulty cage (misxster05, THANKS!)
************************************************** ******************************}

Function CheckCage(Var slot: Integer): Boolean;
Var
i: Integer;

Begin
For i:= 1 To 4 Do
Begin
If(ExistsItem(i)) Then
Begin
MMouseItem(i);
If(IsUpText('cage')) Then
Begin
Result:= True;
slot:= i;
Exit;
End;
End;
End;
End;

{************************************************* ******************************
Check for a faulty net (misxster05, THANKS!)
************************************************** ******************************}

Function CheckNet(Var slot: Integer): Boolean;
Var
i: Integer;

Begin
For i:= 1 To 4 Do
Begin
If(ExistsItem(i)) Then
Begin
MMouseItem(i);
If(IsUpText('ishing')) and IsUpText('net') Then
Begin
Result:= True;
slot:= i;
Exit;
End;
End;
End;
End;

{************************************************* ******************************
End
************************************************** ******************************}


misxsterx06 made the CheckRod, i made these others :)
Please post any things that make it better and work 10/10 :)

mixster
02-11-2008, 07:51 PM
You added an extra s to my name >< ahwell. Also might be an idea to make an extra couple of integers to choose where to search (and change the for loop to 'For i:= startSlot to endSlot do'. Another option is to add a string variable so it can be used flexibly (and would be shorter as you'd only need 1) to check for items. Lastly, what is extra 'ait' for on the fishing rod? I was thinking because it says 'bait fishing rod' but not sure. Otherwise it's great, but my view is biased and not worth much ;)

Gumleren
02-12-2008, 11:49 AM
Checking each slot with the mouse is quite unhuman. Do a DTM-check instead. But other than that it's a good idea. :)

Dumpin
02-12-2008, 01:20 PM
existItem looks at colors without the mouse....

Negaal
02-12-2008, 02:51 PM
More complex:p
Function CheckWhatEver(Var Slot: Integer Item : string): Boolean;
Var
i: Integer;
Begin
For i:= 1 To 4 Do
Begin
If(ExistsItem(i)) Then
Begin
MMouseItem(i);
If pos(item, Rs_GetUpText) > 0 Then
Begin
Result:= True;
slot:= i;
Exit;
End;
End;
End;
End;

Floor66
02-12-2008, 03:47 PM
I wanted this, cuz my DTM's failed sometimes, so i use this as failsafe

Markus
02-12-2008, 04:04 PM
There already is a fishing net finding function in SRL, in my Evil Bob solver ;)

function FishingNetInInv: Boolean;

TheGuyWhoGotOn
02-12-2008, 04:33 PM
You should fix your standards in the sense of not capitalizing the bold words.

Floor66
02-12-2008, 06:40 PM
Yeh, i know, but mixster05 did that.. :) (no offence)

mixster
02-12-2008, 07:48 PM
Don't Reveal My Overcapitalizing To The World ><
I just do it from habit (when first learning scar, I got told to capitalize constants, begins etc. and all procedures/functions - it spread to bold words to somehow)