Lolsen
2014-02-25 04:42:45
Hi guys, so I've started creating my own Charm Sprite script and I've got to the point where I need it to recognise that a lure has been thrown, so this is what I did ( this may be a little unorthodox :P )
Firstly I say my script finds the bushes easy and does throw a lure at them, (haven't distinguished from the shaking bushes atm, and it just throws at all bushes, but I'll get to that), so I wanted a way that my script would recognize a lure has been thrown and for it to move onto the next procedure, so I used a repeat until.
For the until I created a DTM for the Spirit lure that has been thrown.
But my script still just throws the spirit lure then tries to throw again. straight away.
This is my script at the moment!
Firstly I say my script finds the bushes easy and does throw a lure at them, (haven't distinguished from the shaking bushes atm, and it just throws at all bushes, but I'll get to that), so I wanted a way that my script would recognize a lure has been thrown and for it to move onto the next procedure, so I used a repeat until.
For the until I created a DTM for the Spirit lure that has been thrown.
But my script still just throws the spirit lure then tries to throw again. straight away.
This is my script at the moment!
program LolsenCharmSprite;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I SPS/lib/sps-rs3.Simba}
procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := 'username';
password := 'password';
isActive := true;
isMember := true;
end
currentPlayer := 0;
end;
procedure loadDTMs();
var
lureDTM: integer;
luredDTM: integer;
begin
lureDTM := DTMFromString('mggAAAHicY2NgYGhkZmBoAOJ2IK5ghvBbgfgzIwPDEyD+CsTfgfgPEL8AYiMDA4aO7n4GTXV1BncXFwYne3sG36BIBkkG7IARB4YAANbzDh0=');
luredDTM := DTMFromString('mbQAAAHicY2VgYOAEYhEg5meAAG4g5gFiQSCWAGIBqLipkRGDtJQUg6a6OoOTvT2DkYEBgyQDJmDEgsEAAMa7A1E=');
end;
procedure areWeLoggedIn();
begin
if isLoggedIn() then
writeLn('Well, we are not not logged in, thats a start!');
end;
procedure findNeverBerryBush();
var
luredDTM, x, y, i: integer;
begin
if not isLoggedIn() then
exit;
repeat
mainscreen.findObject(x, y, 1657928, 2, colorSetting(2, 1.29, 6.63), mainscreen.playerPoint, 40, 40, 30, ['arget', 'ush'], MOUSE_LEFT);
wait(randomRange(1000, 2000));
inc(i);
luredDTM := DTMFromString('mbQAAAHicY2VgYOAEYhEg5meAAG4g5gFiQSCWAGIBqLipkRGDtJQUg6a6OoOTvT2DkYEBgyQDJmDEgsEAAMa7A1E=');
until findDTM(luredDTM, x, y, tabBackPack.getBounds());
end;
procedure targetNeverBerry();
begin
//code here
end;
procedure targetLure();
begin
//code here
end;
procedure catchSprite();
begin
//code here
end;
{Main Loop}
begin
clearDebug();
smartEnableDrawing := true;
setupSRL();
declarePlayers();
if not isLoggedIn() then
begin
players[currentPlayer].login();
exitSquealOfFortune();
mainScreen.setAngle(MS_ANGLE_HIGH);
minimap.setAngle(MM_DIRECTION_NORTH);
end;
findNeverBerryBush();
targetNeverBerry();
targetLure();
catchSprite();
end.
//I want to create a script that hunts Charm Sprites, it does this by recognizing that it is in the right area,
//It then targets a Neverberry Bush that is shaking, throws a lure to it, targets the lure and catches the
//charm sprites that appear.