fady
2015-02-24 11:54:45
Hello, everyone.
I've been leeching off the forums for about 3 weeks now, and I've finally found the time to start learning and making my own script. Honestly, you guys do some amazing work and I cant begin to comprehend half of what is written in most scripts.
So, I've read both of TheMayor's tutorials multiple times, and I wanted to work on a simple script that would make headless arrows from shafts+feathers.
just action bar 1, production screen 1, wait till its done, repeat. However, sometimes when I alt tab, keyboard inputs to SMART will stop working, so I wanted to add a fail safe, where if the action bar 1 click didn't open a production window, the script would click on backpack slot one to open the production window and then proceed to create shafts. Which was working good, but I couldn't figure out how to tell the script to stop when i run out of shafts, and this is where I'm at now. I thought I'd add a feature in the fail safe where it would only work if the mouse over text received was "Feather Arrow Shaft", and this is what I have in a script as a whole. It is fairly simple and all the thanks go to The Mayor's tutorials, much of mine are just bits and pieces of his tutorials patched together.
This is the script so far. I have it click action bar 1 and wait for a production screen, if not open, use mouse to move over slot 1 and detect the mouse over text, but it always comes back as false. I havent figured out how im going to use the mouse over text response to stop my script because i only know how to repeat until false, but i haven't been able to get the mouse over text to work in the first place.
Any help would be much appreciated
Thank you
I've been leeching off the forums for about 3 weeks now, and I've finally found the time to start learning and making my own script. Honestly, you guys do some amazing work and I cant begin to comprehend half of what is written in most scripts.
So, I've read both of TheMayor's tutorials multiple times, and I wanted to work on a simple script that would make headless arrows from shafts+feathers.
just action bar 1, production screen 1, wait till its done, repeat. However, sometimes when I alt tab, keyboard inputs to SMART will stop working, so I wanted to add a fail safe, where if the action bar 1 click didn't open a production window, the script would click on backpack slot one to open the production window and then proceed to create shafts. Which was working good, but I couldn't figure out how to tell the script to stop when i run out of shafts, and this is where I'm at now. I thought I'd add a feature in the fail safe where it would only work if the mouse over text received was "Feather Arrow Shaft", and this is what I have in a script as a whole. It is fairly simple and all the thanks go to The Mayor's tutorials, much of mine are just bits and pieces of his tutorials patched together.
program scriptTemplate;
{$DEFINE SMART} // Always have this to load smart
{$I SRL-6/SRL.simba} // To load the SRL include files
{$I SPS/lib/SPS-RS3.Simba} // To load the SPS include files
procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := 'user';
password := 'password';
isActive := true;
isMember := false;
end
currentPlayer := 0;
end;
procedure aBarKeyClick();
begin
typeSend('1', false); // keyboard Actionbar slot 1 (Shafts)
end;
procedure aBarKeyHeadless();
begin
productionScreen.clickStart(); // Click the start button
if progressScreen.isOpen(5000) then // if progressScreen is open within 5 seconds
begin
writeLn('Making headless arrows!');
repeat
wait(1000);
until (not progressScreen.isOpen()); // Repeat waiting 1 second until it's not open anymore
end;
end;
procedure mouseHeadless();
begin
tabBackPack.mouseSlot(1, MOUSE_MOVE); //Move mouse to slot 1
if isMouseOverText(['eather Arrow Shaft']) then
fastClick(MOUSE_Left); // Left click(Shafts)
if productionScreen.isOpen(1500) then // If productionScreen is open within 1.5 seconds
begin
productionScreen.clickStart(); // Click the start button
if progressScreen.isOpen(5000) then // if progressScreen is open within 5 seconds
begin
writeLn('Making headless arrows using failsafe!');
repeat
wait(1000);
until (not progressScreen.isOpen()); // Repeat waiting 1 second until it's not open anymore
end;
end;
end;
// main loop
begin
clearDebug(); // Clear the debug box
smartEnableDrawing := true; // So we can draw on SMART
setupSRL(); // Load the SRL include files
declarePlayers(); // Set up your username/pass
if not isLoggedIn() then // If player isn't logged in then
begin
players[currentPlayer].login(); // Log them in
exitTreasure(); // Exit treasure hunter
minimap.setAngle(MM_DIRECTION_NORTH); // Make compass north and angle high
mainScreen.setAngle(MS_ANGLE_HIGH);
end;
aBarKeyClick();
if not productionScreen.isOpen(1500) then // If productionScreen is not open within 1.5 seconds
begin
mouseHeadless();
end else
aBarKeyHeadless();
end.This is the script so far. I have it click action bar 1 and wait for a production screen, if not open, use mouse to move over slot 1 and detect the mouse over text, but it always comes back as false. I havent figured out how im going to use the mouse over text response to stop my script because i only know how to repeat until false, but i haven't been able to get the mouse over text to work in the first place.
Any help would be much appreciated
Thank you