TylerT
2014-08-04 01:31:55
So for my Simba Farm, it would be helpful to know the real-time prices of the herbs and their unf potions.. Ie:
I've got pretty far on my own, but I think I've stumbled on my limits.. I need to find how much the herb or potion actually bought for on the grand exchange. The script so far buys a herb but I cant think of a way to detect the text of the actual price it sold for. You know what I mean? If anyone cant help me with that that would be awesome.
Anyways, current features of my script:
1) Can find the GE and open it from anywhere within the GE area.
2) Has some antibans, not many because its not an actual bot, but still has options to randomly do them.
Future features after it gets working perfectly for my needs:
1) Any item support, not just Herbs/Pots; then it will be useful for everyone
2) Tele to the GE, not really needed but would be fun to add.
3) Make it absolutely flawless
4) Endless Customization settings lol, Amount to buy for, Which GE spaces to use, etc..
5) Uploads margins to my domain and stores in a database to track prices long-term
Obviously these are extremely big goals for my first script but eh I can dream. Anyways, take a look at my script and hopefully you guys can help me get passed this road bump.
Toadflax Potion (unf) Price - Clean Toadflax = Profit. I'm attempting, for my first script, to make a script that logs in every 1 hour(not implemented yet), using the Simba Breaking System, and then gets the margins of all the potions.I've got pretty far on my own, but I think I've stumbled on my limits.. I need to find how much the herb or potion actually bought for on the grand exchange. The script so far buys a herb but I cant think of a way to detect the text of the actual price it sold for. You know what I mean? If anyone cant help me with that that would be awesome.
Anyways, current features of my script:
1) Can find the GE and open it from anywhere within the GE area.
2) Has some antibans, not many because its not an actual bot, but still has options to randomly do them.
Future features after it gets working perfectly for my needs:
1) Any item support, not just Herbs/Pots; then it will be useful for everyone
2) Tele to the GE, not really needed but would be fun to add.
3) Make it absolutely flawless
4) Endless Customization settings lol, Amount to buy for, Which GE spaces to use, etc..
5) Uploads margins to my domain and stores in a database to track prices long-term
Obviously these are extremely big goals for my first script but eh I can dream. Anyways, take a look at my script and hopefully you guys can help me get passed this road bump.
// Made by TylerT //
///////////////////////////////////////////////////////////////////////
// //
// Just start somewhere in the ge, F2P or P2P //
// At the moment, it buys Vials of Water //
// instead of herbs so you can test on f2p accounts //
// Press Play //
// //
///////////////////////////////////////////////////////////////////////
program priceChecker;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
var
lantadyme: Boolean;
cadantine: Boolean;
kwuarm: Boolean;
avantoe: Boolean;
irit: Boolean;
toadflax: Boolean;
ranarr: Boolean;
//end of price check herbs
DTMmiddleGE := DTMFromString('mbQAAAHicY2VgYFjDBsEbgHgdEK8AYn9GBoYgIA4AYi8g9gHinKPXGTyWHGLw236GQUvfiEFbXY1BEqgfHTNiwWAAAFw8DBo=');
DTMherbSYMBOL := DTMFromString('mbQAAAHicY2VgYLjBxsBwBYhvA/ElIL4LxBaMDAxWQGwDxEZQXLXQi8EkUJ7BwU+DISnUlOHkqkAGSaB+dMyIBYMBADofC2I=');
DTMgePerson := DTMFromString('mbQAAAHicY2VgYEgD4nggjgPiPCDOBmJORgYGHiBmBmJ2IOYFYlMVPwYzFX8GA0UXIHZlMFRyY5AEqkXHjFgwGAAAkHMFyQ==');
DTMgeBUYOFFER := DTMFromString('mggAAAHicY2NgYHCAYj0gDgBifyA2BOJ2IK4G4mIgLgHiaUA8FYhdlPkYNp1gZlByDmaQtvFj4NEwY+DVtWWQBMphw4w4MAQAAARGCWU=');
DTMgeCOMPLETE := DTMFromString('mbQAAAHicY2VgYPgLxLuh2IYRgucC2dOBeAEUg9j2TXIMhmkSYAxjSwLF0TEjFgwGAPjlCks=');
procedure startUp();
begin
writeLn('===========================================================================================');
writeLn('You are now using Tylers Margin Automator. Prepare your Anus.');
writeLn('===========================================================================================');
wait(300);
end;
procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := ''; //Change this to your login
password := ''; //Change this to your password.
isActive := true;
isMember := true;
end;
currentPlayer := 0;
end;
procedure loadDTM();
var
DTMmiddleGE: integer;
DTMherbSYMBOL: integer;
DTMgeBUYOFFER: integer;
begin
DTMmiddleGE := DTMFromString('mbQAAAHicY2VgYFjDBsEbgHgdEK8AYn9GBoYgIA4AYi8g9gHinKPXGTyWHGLw236GQUvfiEFbXY1BEqgfHTNiwWAAAFw8DBo=');
DTMherbSYMBOL := DTMFromString('mbQAAAHicY2VgYLjBxsBwBYhvA/ElIL4LxBaMDAxWQGwDxEZQXLXQi8EkUJ7BwU+DISnUlOHkqkAGSaB+dMyIBYMBADofC2I=');
DTMgePerson := DTMFromString('mbQAAAHicY2VgYEgD4nggjgPiPCDOBmJORgYGHiBmBmJ2IOYFYlMVPwYzFX8GA0UXIHZlMFRyY5AEqkXHjFgwGAAAkHMFyQ==');
DTMgeBUYOFFER := DTMFromString('mggAAAHicY2NgYHCAYj0gDgBifyA2BOJ2IK4G4mIgLgHiaUA8FYhdlPkYNp1gZlByDmaQtvFj4NEwY+DVtWWQBMphw4w4MAQAAARGCWU=');
writeLn('DTMs Loaded.');
end;
procedure placeOffers(); // <--- The meat and potatoes are in here
var
scrollDTM, c, v: integer;
// set to false if you dont want a price check on that herb=====================================================================================================
lantadyme:= True; //=============================================================================================================================
cadantine:= True; //=============================================================================================================================
kwuarm:= True; //=============================================================================================================================
avantoe:= True; //=============================================================================================================================
irit:= True; //=============================================================================================================================
toadflax:= True; //=============================================================================================================================
ranarr:= True; //=============================================================================================================================
// end of herb selection =============================================================================================================================
clickArea: TBox;
addFiveBtn: TBox;
addOneBtn: TBox;
confirmOfferBtn: TBox;
itemNameLantadyme: TPoint;
itemNameCadantine: TPoint;
itemNameKwuarm: TPoint;
itemNameAvantoe: TPoint;
itemNameIrit: TPoint;
itemNameToadflax: TPoint;
itemNameRanarr: TPoint;
x, y: integer;
begin
DTMgeBUYOFFER := DTMFromString('mggAAAHicY2NgYHCAYj0gDgBifyA2BOJ2IK4G4mIgLgHiaUA8FYhdlPkYNp1gZlByDmaQtvFj4NEwY+DVtWWQBMphw4w4MAQAAARGCWU=');
DTMgeCOMPLETE := DTMFromString('mbQAAAHicY2VgYPgLxLuh2IYRgucC2dOBeAEUg9j2TXIMhmkSYAxjSwLF0TEjFgwGAPjlCks=');
if findDTM(DTMgeBUYOFFER, c, v, mainscreen.getBounds()) then
begin
mouse(c, v, 3, 3, MOUSE_LEFT);
writeLn('Clicking to make a buy offer');
wait(randomRange(1000, 2000));
if irit = true then
begin
typeSend('Vial Of Water', false);
writeLn('Typed Herb Name');
wait(randomRange(5000, 7000));
clickArea := intToBox(100, 440, 140, 440); // Im using alot of TBoxes because the GE window should never move if your using the right game settings
mouseBox(clickArea, MOUSE_LEFT);
wait(randomRange(500, 1500));
// Above: Enters and selects Item ================ Below: Buys item for 15% over med price
addOneBtn := intToBox(90, 235, 110, 250); // Im using alot of TBoxes because the GE window should never move if your using the right game settings
mouseBox(addOneBtn);
mouseBox(intToBox(90, 235, 110, 250), MOUSE_LEFT);
wait(randomRange(500, 1500));
addFiveBtn := intToBox(455, 235, 480, 250); // Im using alot of TBoxes because the GE window should never move if your using the right game settings
mouseBox(addFiveBtn);
mouseBox(intToBox(455, 235, 480, 250), MOUSE_LEFT); //Clicks once,
mouseBox(intToBox(455, 235, 480, 250), MOUSE_LEFT); //....and twice...
mouseBox(intToBox(455, 235, 480, 250), MOUSE_LEFT); //....last time I promise....
wait(randomRange(500, 1500));
confirmOfferBtn := intToBox(215, 315, 350, 330); // Im using alot of TBoxes because the GE window should never move if your using the right game settings
mouseBox(confirmOfferBtn, MOUSE_LEFT);
mouseBox(intToBox(215, 315, 350, 330), MOUSE_LEFT);
wait(randomRange(500, 1500));
writeLn('Attempting to buy GE offer...');
wait(randomRange(1500, 2500));
if findDTM(DTMgeCOMPLETE, x, y, mainscreen.getBounds()) then
begin
writeLn('Offer Completed, going to recording price');
mouse(x, y, 1, 1, MOUSE_LEFT);
if (findText(p, ['Lobby'], [upCharsEx], tabLogout.bounds)) then //Finds and records price
writeln('Found "Exit to Lobby" text');
end else
writeLn('Offer didnt buy not a good profit anyways then moving on lol');
end else
writeLn('Irit not selected, Trying next herb');
end else
writeLn('Cant find DTMgeBUYOFFER, is your GE full of offers? Do you have any items to Price Check?');
end;
procedure Antiban; //stolen code - Thx Ashaman & C0h3n
begin
if not isLoggedIn() then
begin
writeln('We got logged out, logging back in!');
exit;
end;
begin
case Random(50) of
1..9: begin
WriteLn('Mouse off client');
MouseOffClient(Random(4));
wait(randomRange(5000, 12500));
end;
11..19: begin
WriteLn('Hovering Random Skill');
hoverRandomSkill();
end;
21..29: begin
WriteLn('Executing Bored Human'); // Sometimes on of these Antibans mess with my script
//but I cant figure out which one :< If the script fails, thats probably why
BoredHuman;
wait(randomRange(1000, 3500));
minimap.setAngle(MM_DIRECTION_NORTH);
mainScreen.setAngle(MS_ANGLE_HIGH);
end;
31..39: begin
WriteLn('Executing Bored Human');
BoredHuman;
wait(randomRange(1000, 3500));
minimap.setAngle(MM_DIRECTION_NORTH);
mainScreen.setAngle(MS_ANGLE_HIGH);
end;
41..49: begin
SleepAndMoveMouse(Random(100));
WriteLn('Sleepy mouse');
end;
end;
end;
end;
procedure doAntiban(); //Rolls the die and determines if script will run an antiban or not
begin
writeLn('Rolling the die, will we do an Antiban?');
case Random(5) of
1..3: begin
Antiban();
writeLn('Doing an Antiban!');
end;
4..5: begin
writeLn('No Antiban this time brah');
end;
end;
end;
procedure openGE();
var
scrollDTM, t, r: integer;
begin
mainscreen.setZoom(true);
DTMgePerson := DTMFromString('mbQAAAHicY2VgYEgD4nggjgPiPCDOBmJORgYGHiBmBmJ2IOYFYlMVPwYzFX8GA0UXIHZlMFRyY5AEqkXHjFgwGAAAkHMFyQ==');
if findDTM(DTMgePerson, t, r, mainscreen.getBounds()) then
begin
mouse(t, r, 1, 1, MOUSE_LEFT);
writeLn('Found ge person FUCK YES');
wait(randomRange(3500, 8000));
placeOffers();
end else
writeLn('Cant find DTMgePerson');
end;
procedure findHerbSymbol();
var
scrollDTM, p, q: integer;
begin
DTMherbSYMBOL := DTMFromString('mbQAAAHicY2VgYLjBxsBwBYhvA/ElIL4LxBaMDAxWQGwDxEZQXLXQi8EkUJ7BwU+DISnUlOHkqkAGSaB+dMyIBYMBADofC2I=');
minimap.setAngle(MM_DIRECTION_NORTH);
mainscreen.setAngle(MS_ANGLE_HIGH);
if findDTM(DTMherbSYMBOL, p, q, minimap.getBounds()) then
begin
mouse(p, q, 1, 1, MOUSE_LEFT);
writeLn('Found herb symbol FUCK YES');
mainscreen.setZoom(true);
minimap.waitPlayerMoving();
openGE();
end else
writeLn('Cant find DTMherbSYMBOL');
end;
procedure findMiddle();
var
scrollDTM, x, y: integer; // copy/paste from older script of mine
begin
DTMmiddleGE := DTMFromString('mbQAAAHicY2VgYFjDBsEbgHgdEK8AYn9GBoYgIA4AYi8g9gHinKPXGTyWHGLw236GQUvfiEFbXY1BEqgfHTNiwWAAAFw8DBo=');;
minimap.setAngle(MM_DIRECTION_NORTH);
mainscreen.setAngle(MS_ANGLE_HIGH);
if findDTM(DTMmiddleGE, x, y, minimap.getBounds()) then
begin
mouse(x, y, 2, 2, MOUSE_LEFT);
writeLn('Found middle of ge FUCK YES');
doAntiban();
minimap.waitPlayerMoving();
mainscreen.setZoom(true);
findHerbSymbol();
end else
writeLn('Cant find DTMmiddleGE');
exit;
end;
begin //main loop
begin
clearDebug();
setupSRL();
clearDebug();
end;
startUp();
declarePlayers();
players[currentPlayer].login();
clearDebug();
WriteLn('Logged in, waiting a bit cuz lag sucksss');
wait(randomRange(2000, 3000));
loadDTM();
wait(randomRange(500, 1000));
placeOffers();
findMiddle();
end. //end main loop