I have read a few tuts and things (its actually rather annoying since some of them are old and the includes don't work therefor them procedures arent useable anymore..) but anyway I was just playing around with a script trying to get it to kill some Goblins, this is what I have so far...
Code:Program GoblinKiller; {.include SRL/SRL.Scar} var OresMined, TotalProggies, x,y : Integer; Const MonsterName = 'Goblin'; MonsterColourOne = 2986635; MonsterColourTwo = 3053713; MonsterColourThree = 6066293; Procedure Attack; begin; if findcolor(x,y,MonsterColourOne,4,4,514,335) then; Mouse(x, y, 10, 10, False); else; if findcolor(x,y,MonsterColourTwo,4,4,514,335) then; Mouse(x, y, 10, 10, False); else; if findcolor(x,y,MonsterColourThree,4,4,514,335) then; Mouse(x, y, 10, 10, False); else; Writeln('We could not find that Monster.'); Wait(5000); end; Procedure GoblinsKilled; begin Wait(15000); inc(TotalProggies); ClearDebug; TimeRunning; Writeln('This has been running for ' + (Timerunning) + '.'); Writeln('You have killed ' (------------) ' ' + MonsterName + 's'); Writeln('We have updated you ' + IntToStr(TotalProggies) + ' times.'); end; Begin Repeat Attack; GoblinsKilled; Until(false); end.
What I am having problems with is the 'Attack' Part;
Code:Procedure Attack; begin; if findcolor(x,y,MonsterColourOne,4,4,514,335) then; Mouse(x, y, 10, 10, False); else; if findcolor(x,y,MonsterColourTwo,4,4,514,335) then; Mouse(x, y, 10, 10, False); else; if findcolor(x,y,MonsterColourThree,4,4,514,335) then; Mouse(x, y, 10, 10, False); else; Writeln('We could not find that Monster.'); Wait(5000); end;
I can not get the command 'Else' to work, it just comes up saying 'Line 16: [Error] (19838:1): Identifier expected in script ' Unless I take the 'else' out.
Another problem I have is the mouse speed, for some reason the mouse moves reaaaaaly slow to get to places and this only happens my script and I dont know why. Any help would be loved and ++rep.
Another thing I need help with that you might see in the code is
I haven't really figured out how to make it tell you how many it has killed.Code:Writeln('You have killed ' (------------) ' ' + MonsterName + 's');
once again thanks for the help in advance!
(Ps Ive been here a week and have over 10 posts, does my JRN status happen automaticly?)


Reply With Quote










