Guest User

Untitled

a guest
May 27th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. program BBW;
  2. {$DEFINE SMART}
  3. {$i SRL/srl.simba}
  4.  
  5. procedure DeclarePlayers;
  6. begin
  7. HowManyPlayers:= 1;
  8. CurrentPlayer:= 0;
  9. NumberOfPlayers(HowManyPlayers);
  10.  
  11. with Players[0] do
  12. begin
  13. Name := 'nick'; // char name
  14. Pass := 'pass'; // char pass
  15. Active := True; // player active
  16. end;
  17. end;
  18.  
  19. function GetFoodArr(var FoodInvArr: TIntegerArray; out FoodExists: Boolean): TIntegerArray;
  20. // searches inventory spots and returns an array if uptext contains eat and true if food exists
  21. var
  22. i, ii, h, l: Integer;
  23. TempArr: TIntegerArray;
  24. ItemBox: TBox;
  25. ItemUptext: String;
  26. begin
  27. SetLength(FoodInvArr, 28);
  28. SetLength(TempArr, 28);
  29. SetLength(Result, 28);
  30.  
  31. GameTab(tab_Inv);
  32. wait(75+Random(5));
  33. for i := 1 to 28 do
  34. begin
  35. if(ExistsItem(i)) then
  36. TempArr[i-1] := i;
  37. end;
  38. for I := 0 to High(TempArr) do
  39. begin
  40. if (TempArr[i] = 0) then
  41. (DeleteValueInIntArray(TempArr, i));
  42. ClearSameIntegers(TempArr);
  43. end;
  44. writeln('TempArr: '+ToStr((TempArr)));
  45. h := high(TempArr);
  46. writeln('h: '+ToStr((h)));
  47. SetLength(Result, Length(TempArr));
  48. l := Low(TempArr);
  49. writeln('l: '+ToStr((l)));
  50.  
  51. for ii := l to h do
  52. begin
  53. if ii <= 1 then ItemBox := InvBox(TempArr[ii]) else
  54. ItemBox := InvBox(TempArr[ii]+1);
  55. MouseBox(ItemBox.X1, ItemBox.Y1, ItemBox.X2, ItemBox.Y2, mouse_move);
  56. wait(200);
  57. ItemUptext := GetUpText;
  58. if (Pos('Eat',ItemUptext) > 0) then
  59. begin
  60. writeln('Found Eat in uptext in InvSlot:'+tostr(TempArr[ii]+1));
  61. FoodExists := True;
  62. Result[ii] := TempArr[ii];
  63. writeln('Result := '+tostr(Result));
  64. end;
  65. end;
  66. end;
  67.  
  68. var arr: TIntegerArray; exists: Boolean;
  69. begin
  70. Smart_Server := 108;
  71. Smart_Members := False;
  72. Smart_Signed := True;
  73. Smart_SuperDetail := False;
  74. setupSRL();
  75. DeclarePlayers;
  76.  
  77. LoginPlayer;
  78. wait(1000);
  79. GetFoodArr(Arr, Exists);
  80. writeln('Arr: '+tostr(Arr)+' Exists: '+tostr(Exists));
  81. end.
  82.  
  83. // OUTPUTS
  84. {SMART Initialized.
  85. Loaded: Server 32, Members: False, Signed: True, Super Detail: False.
  86. TempArr: [1, 2, 3, 4, 5, 6, 7, 8]
  87. h: 7
  88. l: 0
  89. Found Eat in uptext in InvSlot:2
  90. Result := [1, 0, 0, 0, 0, 0, 0, 0]
  91. Found Eat in uptext in InvSlot:6
  92. Result := [1, 0, 0, 0, 5, 0, 0, 0]
  93. Found Eat in uptext in InvSlot:8
  94. Result := [1, 0, 0, 0, 5, 0, 7, 0]
  95. 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
  96. Successfully executed. }
Add Comment
Please, Sign In to add comment