However I can't get Attach() to work with this Java application, so I wonder if I'm just retarded to get this working (Attach("Haven and Hearth","SunAwtCanvas"); would just end up making the bot do nothing) or do I miss something there.
Code: Select all
exp2 = 0;
exp3 = 0;
exp = 300;
variable2 = 0;
-- Move to Building
function openBuilding(x0,y0)
mouseSet(x0, y0);
mouseRClick();
rest(5000);
end
-- Put the Item into the Building
function putItem(x3,y3,buildx,buildy,x4,y4)
exp2 = exp2+1;
exp3 = exp3+1;
keyboardHold( key.VK_SHIFT );
mouseSet(x3, y3);
mouseLClick();
keyboardRelease( key.VK_SHIFT );
rest(100);
mouseSet(buildx, buildy);
mouseLClick();
rest(100);
keyboardHold( key.VK_SHIFT );
mouseSet(x4, y4);
mouseLClick();
keyboardRelease( key.VK_SHIFT );
rest(9600);
printf("LP: +%d | %d/%d | Eaten: %d\n",exp3*15,exp2,exp,variable2);
end
function getApple(x1,y1,atimes,aposX,aposY)
exp2 = 0;
for variable = 0, atimes, 1 do
printf("Eating Apple: %d \n",variable);
-- Walk to tree & get an apple
mouseSet(x1, y1);
mouseRClick();
rest(700);
mouseMove(30,-30);
rest(100);
mouseLClick();
rest(3000);
-- Eat Apple
mouseSet(aposX, aposY);
rest(100);
mouseRClick();
rest(800);
mouseMove(0, -30);
rest(100);
mouseLClick();
-- Drop / Repeat
rest(500);
variable2 = variable2+1;
end
end
while true do
putItem(142,160,347,333,347,297);
-- Move to Appletree after X runs
if(exp2 >= exp)then
getApple(509,301,1,175,162);
openBuilding(576,381);
end
end