CaydDmann Posted November 19, 2011 Share Posted November 19, 2011 (edited) I'm trying to make a script that automatically bakes brownies... here's what I have got. I keep getting errors about "Identifier expected". I'm still new at this, could you help please? program AutoBrownieBaker; var Cook: Integer; Brownies: Integer; Exitbutton: Integer; Ok: Integer; Prepare: Integer; Prepare2: Integer; Prepare3: Integer; Serve: Integer; Login: Integer; Levelup: Integer; x,y: Integer; procedure LoadBmps; begin Levelup:= BitmapFromString(1, 1, 'beNrLSDsPAALWAZ4='); Ok:= BitmapFromString(1, 1, 'beNpLKX4GAAL7Ab4='); Prepare:= BitmapFromString(1, 1, 'beNq7u+YTAATkAnw='); Prepare2:= BitmapFromString(1, 1, 'beNpzkugGAAGEAOY='); Prepare3:= BitmapFromString(1, 1, 'beNpbvasXAAQFAfM='); Serve:= BitmapFromString(1, 1, 'beNq7/fQiAAUvApI='); Login:= BitmapFromString(1, 1, 'beNq7ceMGAAUTAok='); Cook:= BitmapFromString(1, 1, 'beNqbMWMGAAOTAck='); Exitbutton:= BitmapFromString(1, 1, 'beNqbHHoQAAMnAao='); Brownies:= BitmapFromString(1, 1, 'beNp7/PMRAAWAAr8='); end; procedure UseBitmap; begin if(FindBitmap(Levelup,x,y)) then begin wait(500) ClickMouse(x,y,true); end; begin if(FindBitmap(Ok,x,y)) then begin wait(2000) ClickMouse(x,y,true); wait(500) end; begin if(FindBitmap(Exitbutton,x,y)) then begin wait(500) ClickMouse(x,y,true); end; begin if(FindBitmap(Prepare,x,y)) then begin wait(500); ClickMouse(x,y,true); end; begin if(FindBitmap(Prepare2,x,y)) then begin wait(500); ClickMouse(x,y,true); end; begin if(FindBitmap(Prepare3,x,y)) then begin wait(500); ClickMouse(x,y,true); end; begin if(FindBitmap(Serve,x,y)) then begin wait(500); ClickMouse(x,y,true); end; begin if(FindBitmap(Login,x,y)) then begin wait(500); ClickMouse(x,y,true); end; begin if(FindBitmap(Cook,x,y)) then begin wait(500); ClickMouse(x,y,true); end; begin if(FindBitmap(Brownies,x,y)) then begin wait(500); ClickMouse(x,y,true); end; end. Edited November 19, 2011 by Freddy Quote Link to comment Share on other sites More sharing options...
zippoxer Posted November 19, 2011 Share Posted November 19, 2011 'begin' is used to start a new block of code, there's no need to write 'begin' after an 'end' statement. if(FindBitmap(Levelup,x,y)) then begin wait(500) ClickMouse(x,y,true); end; [u][b]begin <- wrong, should be removed[/b][/u] if(FindBitmap(Ok,x,y)) then begin wait(2000) ClickMouse(x,y,true); wait(500) end; Quote Link to comment Share on other sites More sharing options...
CaydDmann Posted November 19, 2011 Author Share Posted November 19, 2011 (edited) That's good to know! But now I'm getting semicolon expected errors..? ---MERGED--- Actually nevermind, I figured it out! How would I make this script loop? Like where would I put repeat and until(false) if I wanted it to keep searching+clicking on the bitmaps? program AutoBrownieBaker; var Cook: Integer; Brownies: Integer; Exitbutton: Integer; Ok: Integer; Prepare: Integer; Prepare2: Integer; Prepare3: Integer; Serve: Integer; Login: Integer; Levelup: Integer; x,y: Integer; procedure LoadBmps; begin Levelup:= BitmapFromString(1, 1, 'beNrLSDsPAALWAZ4='); Ok:= BitmapFromString(1, 1, 'beNpLKX4GAAL7Ab4='); Prepare:= BitmapFromString(1, 1, 'beNq7u+YTAATkAnw='); Prepare2:= BitmapFromString(1, 1, 'beNpzkugGAAGEAOY='); Prepare3:= BitmapFromString(1, 1, 'beNpbvasXAAQFAfM='); Serve:= BitmapFromString(1, 1, 'beNq7/fQiAAUvApI='); Login:= BitmapFromString(1, 1, 'beNq7ceMGAAUTAok='); Cook:= BitmapFromString(1, 1, 'beNqbMWMGAAOTAck='); Exitbutton:= BitmapFromString(1, 1, 'beNqbHHoQAAMnAao='); Brownies:= BitmapFromString(1, 1, 'beNp7/PMRAAWAAr8='); end; procedure UseBitmap; begin if(FindBitmap(Levelup,x,y)) then begin wait(500) ClickMouse(x,y,true); end; if(FindBitmap(Ok,x,y)) then begin wait(2000) ClickMouse(x,y,true); wait(500) end; if(FindBitmap(Exitbutton,x,y)) then begin wait(500) ClickMouse(x,y,true); end; if(FindBitmap(Prepare,x,y)) then begin wait(500); ClickMouse(x,y,true); end; if(FindBitmap(Prepare2,x,y)) then begin wait(500); ClickMouse(x,y,true); end; if(FindBitmap(Prepare3,x,y)) then begin wait(500); ClickMouse(x,y,true); end; if(FindBitmap(Serve,x,y)) then begin wait(500); ClickMouse(x,y,true); end; if(FindBitmap(Login,x,y)) then begin wait(500); ClickMouse(x,y,true); end; if(FindBitmap(Cook,x,y)) then begin wait(500); ClickMouse(x,y,true); end; if(FindBitmap(Brownies,x,y)) then begin wait(500); ClickMouse(x,y,true); end; end; begin end. Edited November 19, 2011 by Freddy Quote Link to comment Share on other sites More sharing options...
zippoxer Posted November 20, 2011 Share Posted November 20, 2011 Put repeat before the part you want to repeat and until after it. Like this: program New; begin repeat if(FindBitmap(Levelup,x,y)) then begin wait(500); ClickMouse(x,y,true); end; until 1 = 1; end. Everything between the 'repeat' to 'until' would repeat forever since the condition to keep repeating is 1 = 1, always True. You can also say 'until True'. Quote Link to comment Share on other sites More sharing options...