Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program BBW;
- {$DEFINE SMART}
- {$i SRL/srl.simba}
- procedure DeclarePlayers;
- begin
- HowManyPlayers:= 1;
- CurrentPlayer:= 0;
- NumberOfPlayers(HowManyPlayers);
- with Players[0] do
- begin
- Name := 'nick'; // char name
- Pass := 'pass'; // char pass
- Active := True; // player active
- end;
- end;
- function GetFoodArr(var FoodInvArr: TIntegerArray; out FoodExists: Boolean): TIntegerArray;
- // searches inventory spots and returns an array if uptext contains eat and true if food exists
- var
- i, ii, h, l: Integer;
- TempArr: TIntegerArray;
- ItemBox: TBox;
- ItemUptext: String;
- begin
- SetLength(FoodInvArr, 28);
- SetLength(TempArr, 28);
- SetLength(Result, 28);
- GameTab(tab_Inv);
- wait(75+Random(5));
- for i := 1 to 28 do
- begin
- if(ExistsItem(i)) then
- TempArr[i-1] := i;
- end;
- for I := 0 to High(TempArr) do
- begin
- if (TempArr[i] = 0) then
- (DeleteValueInIntArray(TempArr, i));
- ClearSameIntegers(TempArr);
- end;
- writeln('TempArr: '+ToStr((TempArr)));
- h := high(TempArr);
- writeln('h: '+ToStr((h)));
- SetLength(Result, Length(TempArr));
- l := Low(TempArr);
- writeln('l: '+ToStr((l)));
- for ii := l to h do
- begin
- if ii <= 1 then ItemBox := InvBox(TempArr[ii]) else
- ItemBox := InvBox(TempArr[ii]+1);
- MouseBox(ItemBox.X1, ItemBox.Y1, ItemBox.X2, ItemBox.Y2, mouse_move);
- wait(200);
- ItemUptext := GetUpText;
- if (Pos('Eat',ItemUptext) > 0) then
- begin
- writeln('Found Eat in uptext in InvSlot:'+tostr(TempArr[ii]+1));
- FoodExists := True;
- Result[ii] := TempArr[ii];
- writeln('Result := '+tostr(Result));
- end;
- end;
- end;
- var arr: TIntegerArray; exists: Boolean;
- begin
- Smart_Server := 108;
- Smart_Members := False;
- Smart_Signed := True;
- Smart_SuperDetail := False;
- setupSRL();
- DeclarePlayers;
- LoginPlayer;
- wait(1000);
- GetFoodArr(Arr, Exists);
- writeln('Arr: '+tostr(Arr)+' Exists: '+tostr(Exists));
- end.
- // OUTPUTS
- {SMART Initialized.
- Loaded: Server 32, Members: False, Signed: True, Super Detail: False.
- TempArr: [1, 2, 3, 4, 5, 6, 7, 8]
- h: 7
- l: 0
- Found Eat in uptext in InvSlot:2
- Result := [1, 0, 0, 0, 0, 0, 0, 0]
- Found Eat in uptext in InvSlot:6
- Result := [1, 0, 0, 0, 5, 0, 0, 0]
- Found Eat in uptext in InvSlot:8
- Result := [1, 0, 0, 0, 5, 0, 7, 0]
- Arr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] Exists: True
- Successfully executed. }
Add Comment
Please, Sign In to add comment