So, after many, many, many, many, did I say many request: here's the how-to video that will save my brain from melting everytime someone search the crosshair :lol: Yeah, you heard it right: How to use scar to play a game for you ! Here's the video. Click on "watch in high quality" below the video to be able to read the text there. http://www.youtube.com/watch?v=1_vQUrbgFU0 Enjoy !
Re: [SCAR]How to user SCAR Tharoux one of my good friends on SRL Forums developed a game using SCAR. If you want I can dig it up and put it on here. Do you want me to go ask him first though, I am not sure if he is still active and he freely released it on the Forums. Not sure, anyways its really fun, pretty basic, and yeah so let me know . PS. I helped make it yayyyy! EDIT: Wait is this topic (I haven't watched the vid) for playing a game solely on SCAR or using SCAR to automate a game lol...
Re: [SCAR]How to user SCAR This guide was for using SCAR to play flash game, but feel free to post the game... I like seeing nice coding
Re: [SCAR]How to user SCAR *** All credit goes to munk from SRL Forums . I watched this game develop from pretty much start to finish and it is pretty interesting and a good example of how to make a game and canvases and such. Enjoy! This is the old one but it is bug free pretty much. Spoiler Code (Text): { 8b d8 88 88 88""Yb 8888b. 888888 88""Yb dP"Yb 88 88 .dP"Y8 88b d88 88 88 88__dP 8I Yb 88__ 88__dP dP Yb 88 88 `Ybo." 88YbdP88 Y8 8P 88"Yb 8I dY 88"" 88"Yb Yb dP Y8 8P o.`Y8b 88 YY 88 `YbodP' 88 Yb 8888Y" 888888 88 Yb YbodP `YbodP' 8bodP' 88""Yb db 88""Yb 88 88b 88 dP""b8 88__dP dPYb 88__dP 88 88Yb88 dP `" 88"Yb dP__Yb 88""" 88 88 Y88 Yb "88 88 Yb dP""""Yb 88 88 88 Y8 YboodP 8888P dP"Yb 8b d8 88""Yb 88 888888 .dP"Y8 d8b dP dP Yb 88b d88 88__dP 88 88__ `Ybo." Y8P dP Yb dP 88YbdP88 88""Yb 88 88"" o.`Y8b `"' d8888 YbodP 88 YY 88 88oodP 88 888888 8bodP' (8) these ain't no ordinary zombies... - Arrow Keys to Move - Space Bar to Shoot ...good luck } program game; var f,shootTime,rise,run,rr, hp,score,speed,amount:integer; p,lp:Tpoint; shoot:boolean; type npcInfo = record bmps: array of integer; area: Tbox; text: string; attack: boolean; deadTime: integer; hits: integer; x: integer; y: integer; end; var npc:Array of npcInfo; procedure setupNPC(which,nText:string;nArea:Tbox;nAttack:boolean); var i,ii:integer; good:boolean; begin setArrayLength(npc,length(npc)+1); i:=high(npc); npc[i].text:=nText; npc[i].area:=nArea; npc[i].attack:=nAttack; repeat if rBool then begin if rBool then npc[i].x:=npc[i].area.x1+5 else npc[i].x:=npc[i].area.x2-5; npc[i].y:=randomRange(npc[i].area.y1+5,npc[i].area.y2-5); end else begin npc[i].x:=randomRange(npc[i].area.x1+5,npc[i].area.x2-5); if rBool then npc[i].y:=npc[i].area.y1+5 else npc[i].y:=npc[i].area.y2-5; end; good:=true; for ii:=0 to high(npc) do if i<>ii then if distance(npc[i].x+3,npc[i].y+7,npc[ii].x+3,npc[ii].y+7)<8 then good:=false; until(good); end; procedure killNPC(key:integer); var i,ii:integer; begin for i:=key to high(npc)-1 do begin npc[i].x:=npc[i+1].x; npc[i].y:=npc[i+1].y; npc[i].area:=npc[i+1].area; npc[i].text:=npc[i+1].text; npc[i].attack:=npc[i+1].attack; npc[i].deadTime:=npc[i+1].deadTime; npc[i].hits:=npc[i+1].hits; for ii:=0 to high(npc[i].bmps) do freeBitmap(npc[i].bmps[ii]); npc[i].bmps:=npc[i+1].bmps; // npc[i]. end; setArrayLength(npc,length(npc)-1); end; function drawExplosionOnBitmap(bmp:integer;rx,ry,size:integer;blood:boolean):integer; var ix,iy,dist:integer; begin for ix:=rx-size to rx+size do for iy:=ry-size to ry+size do begin dist:=distance(ix,iy,rx,ry); if random(dist*2)=0 then if intInBox(ix,iy,intToBox(1,1,549,399)) then begin if blood then fastSetPixel(bmp,ix,iy,RGBtoColor(255*(dist/size+1),dist*5,0)) else fastSetPixel(bmp,ix,iy,RGBtoColor(255*(dist/size+1),(255*(dist/size+1))-255,0)) end; end; result:=bmp; end; function drawGuyOnBitmap(bmp:integer;rx,ry,face:integer):integer; var guy:integer; begin case face of // up 0: guy:=BitmapFromString(7, 14, 'beNr7/x8CZjR7Q9D//+giyO' + 'JYBd/eqYWLANmYJvxHAkAFEPQfFTy6VInM9aiahowgIsjicDamIMQ' + 'oV9cZEIRsOIQLIeEAU9DNWhaIEAwAexHRfw=='); 1: guy:=BitmapFromString(7, 14, 'beNr7/x8CZjR7Q9D//ygib' + // right '+/UAhGmoJysJFwQyIWrRFaMKYJLEAgeXar8jwE8qqZhCjrldxApiN' + 'VMV9cZRAq6WcsCEYgFAO1K/O4='); 2: guy:=BitmapFromString(7, 14, 'beNr7/x8CZjR7Q9D//+giy' + // down 'OJAxts7tRAEFwSyGRgY4CTcBLjK/0gAUxkEPLpUicz1qJqGjCAiyO' + 'JwNqYgxChX1xkQhGw4hAsh4QBT0M1aFogQDADBgdKN'); 3,4: guy:=BitmapFromString(7, 14, 'beNr7/x8CZjR7Q9B/JPD2Ti' + // left '0QoYnLyUqiCUKUQQSBJJp2ZBFcgkDw6FLlfwzgUTUNU9Apv4NIQax' + 'murrOIEbQzVoWiKAcAAlb/O4='); end; { case lowercase(which) of 'zombie': begin end; end; } try SetTransparentColor(guy,clWhite); FastDrawTransparent(rx,ry,guy,bmp); result:=bmp; except writeln('oh noez!'); finally freebitmap(guy); end; end; function drawBulletOnBitmap(bmp:integer;rx,ry:integer):integer; var i,ii,mx,my:integer; angle:extended; brk:boolean; begin try angle:=arcTan2(rise,run)+(pi/2); // writeln(floatTostr(ang)); except writeln('setting as pi'); angle:=0; end; if angle<0 then angle:=angle+(2*pi); { case f of 0: angle:=0; 1: angle:=pi/2; 2: angle:=pi; 3: angle:=3*pi/2; end; } for i:=0 to 250 do begin mx:=round(i*sin(angle))+rx; my:=round(-i*cos(angle))+ry; if intInBox(mx,my,intToBox(1,1,549,399)) then begin fastSetPixel(bmp,mx,my,clGray); for ii:=0 to high(npc) do begin if distance(mx,my,npc[ii].x+3,npc[ii].y+7)<10 then begin if npc[ii].deadTime=0 then incEx(score,10); inc(npc[ii].hits); if npc[ii].hits>5 then begin npc[ii].deadTime:=getTickCount-5000; bmp:=drawExplosionOnBitmap(bmp,npc[ii].x+3,npc[ii].y+7,25+random(15),true); incEx(score,25); end else begin npc[ii].deadTime:=getTickCount; bmp:=drawExplosionOnBitmap(bmp,npc[ii].x+3,npc[ii].y+7,7+random(9),true); end; brk:=true; break; end; end; if brk then break; end else break; end; result:=bmp; end; procedure refresh; var i,ii,mx,my,bmp,hud:integer; canMove:boolean; ang:extended; canvas:Tcanvas; begin if (p.x>=0) and (p.x<=550) then if (p.y>=0) and (p.y<=400) then begin bmp:=bitmapFromString(550,400,''); FastDrawClear(bmp,clGreen); hud:=createBitmapFromText('murderous raping zombies by munk', statChars, clWhite); SetTransparentColor(hud,0); FastDrawTransparent(15,12,hud,bmp); FreeBitmap(hud); if not((p.x=lp.x)and(p.y=lp.y)) then begin rise:=p.y-lp.y; run:=p.x-lp.x; lp:=p; end; if (rise<0) then f:=0 else if (rise>0) then f:=2 else if run>0 then f:=1 else if run<0 then f:=3; bmp:=drawGuyOnBitmap(bmp,p.x,p.y,f); end; if shoot then begin bmp:=drawBulletOnBitmap(bmp,p.x-random(4)+random(4)+3,p.y-random(4)+random(4)+5); bmp:=drawExplosionOnBitmap(bmp,p.x+5,p.y+8,2,false); shoot:=false; shootTime:=getTickCount; end; for i:=0 to high(npc) do begin if npc[i].deadTime>0 then begin try if getTickCount-npc[i].deadTime>1500+random(1000) then killNPC(i); bmp:=drawGuyOnBitmap(bmp,npc[i].x,npc[i].y,2); except // writeln('zombie was already dead!'); end; continue; end; try ang:=arcTan2(p.y-npc[i].y,p.x-npc[i].x)+(pi/2); // writeln(floatTostr(ang)); except writeln('setting as pi'); ang:=pi; end; if ang<0 then ang:=ang+(2*pi); mx:=npc[i].x+round(speed*sin(ang)); my:=npc[i].y+round(-speed*cos(ang)); if intInBox(mx,my,intToBox(1,1,549,399)) then begin if distance(mx+3,my+7,p.x+3,p.y+7)<5 then begin dec(hp); if hp<=0 then begin hp:=0; hud:=createBitmapFromText('You Are Dead', npcChars, clRed); SetTransparentColor(hud,0); FastDrawTransparent(215,165,hud,bmp); FreeBitmap(hud); wait(1500); break; end; end; canMove:=true; for ii:=0 to high(npc) do if i<>ii then if npc[ii].deadTime=0 then if distance(mx+3,my+7,npc[ii].x+3,npc[ii].y+7)<8 then begin canMove:=false; break; end; if canMove then begin npc[i].x:=mx; npc[i].y:=my; end; end; bmp:=drawGuyOnBitmap(bmp,npc[i].x,npc[i].y,round(ang div (pi/2))); { if pointInBox(p,npc[i].area) then if trim(npc[i].text)<>'' then begin hud:=createBitmapFromText(npc[i].text, upChars, clWhite); SetTransparentColor(hud,0); FastDrawTransparent(230,360,hud,bmp); freeBitmap(hud); end; } // except // writeln('ERROR'); // end; end; hud:=createBitmapFromText('Health: '+inttostr(hp)+'% Score: '+inttostr(score), upChars, clWhite); SetTransparentColor(hud,0); FastDrawTransparent(15,375,hud,bmp); FreeBitmap(hud); try // SafeDrawBitmap(bmp,GetDebugCanvas,0,0); safeCopyCanvas(GetBitmapCanvas(bmp),GetDebugCanvas,0,0,550,400,0,0,550,400); except writeln('couldnt copy canvas'); end; freeBitMap(bmp); end; procedure postScore; var connect:integer; return:string; var name:string; begin name:=readLn('Enter Name For Hiscores:'); if name<>'' then begin try connect:=InitializeHTTPClient(false,false); AddPostVariable(connect,'name',name); AddPostVariable(connect,'score',inttostr(score)); return:=postHTTPPageEx(connect,'http://munk.awardspace.com/MRZhiscores.php'); FreeHTTPClient(connect); writeln(return);except end;end; end; procedure scriptTerminate; begin getSelf.WindowState:=wsNormal; clearReport; addToReport(' '); addToReport(' Murderous '); addToReport(' Raping '); addToReport(' Zombies v1.0'); addToReport(' '); addToReport(' Score: '+inttostr(score)); postScore; end; var n:integer; begin getSelf.WindowState:=wsMinimized; displayDebugImgWindow(550,400); // FindWindowTitlePart('ebug',false); // activateClient; p:=point(100,100); // setupNPC('','',inttobox(0,0,550,400),true); // setupNPC('','',inttobox(0,0,550,400),true); {npc[0].area:=inttobox(0,0,550,400); npc[0].text:='Zommbbiieeee rrarrh'; npc[0].area:=inttobox(0,0,550,400); npc[1].text:='grarrhagrhrrahr'; npc[0].area:=inttobox(0,0,550,400); npc[2].text:='brraaiinnsssz'; } speed:=1; hp:=100; repeat if length(npc)=0 then begin incEx(amount,2); if amount>25 then begin amount:=2; inc(speed); end; for n:=0 to amount do setupNPC('zombie','',inttobox(0,0,550,400),true); end; inc(rr); if rr mod 2 = 0 then begin refresh; rr:=0; end; if hp<=0 then break; if isKeyDown('p') then begin repeat wait(100); until(not(isKeyDown('p'))); repeat wait(100); until(isKeyDown('p')); repeat wait(100); until(not(isKeyDown('p'))); end; if IsArrowDown(0) then if (p.y>0) then decex(p.y,5); if IsArrowDown(1) then if (p.x<550) then incex(p.x,5); if IsArrowDown(2) then if (p.y<400) then incex(p.y,5); if IsArrowDown(3) then if (p.x>0) then decex(p.x,5); if getTickCount - shootTime > 100 then if isKeyDown(chr(32)) then shoot:=true; // 0 = up, 1 = right, 2 = down, 3 = left. wait(25); until(isFKeyDown(1)); repeat wait(100) until(not(isFKeyDown(1))); end. This is a nicer newer one but for some people it may have a few bugs. Spoiler Code (Text): { 8b d8 88 88 88""Yb 8888b. 888888 88""Yb dP"Yb 88 88 .dP"Y8 88b d88 88 88 88__dP 8I Yb 88__ 88__dP dP Yb 88 88 `Ybo." 88YbdP88 Y8 8P 88"Yb 8I dY 88"" 88"Yb Yb dP Y8 8P o.`Y8b 88 YY 88 `YbodP' 88 Yb 8888Y" 888888 88 Yb YbodP `YbodP' 8bodP' 88""Yb db 88""Yb 88 88b 88 dP""b8 88__dP dPYb 88__dP 88 88Yb88 dP `" 88"Yb dP__Yb 88""" 88 88 Y88 Yb "88 88 Yb dP""""Yb 88 88 88 Y8 YboodP 8888P dP"Yb 8b d8 88""Yb 88 888888 .dP"Y8 d8b dP dP Yb 88b d88 88__dP 88 88__ `Ybo." Y8P dP Yb dP 88YbdP88 88""Yb 88 88"" o.`Y8b `"' d8888 YbodP 88 YY 88 88oodP 88 888888 8bodP' (8) [BETA 2] these ain't no ordinary zombies... ...good luck ~ munk } program mrz; var rise,run,rr,cc,lvlTime, speed,amount:integer; lvlTxt:String; type player = record hp:integer; score:integer; speed:integer; level:integer; shootTime:integer; shoot:boolean; bulletDistance:integer; rapidFire:boolean; explosives:boolean; x:integer; y:integer; lp:Tpoint; end; var mez:array of player; type npcInfo = record bmps: array of integer; area: Tbox; text: string; attack: boolean; deadTime: integer; target: integer; hits: integer; x,y: integer; end; var ctrl:array[0..3] of array[0..4] of integer; var n:integer; frmDesign : TForm; title, watermark, hiscoresTitle : TLabel; optLabel : array of TLabel; topImg : Timage; ComboBox1 : TComboBox; controls : array of TEdit; options : array of Tlabel; var npc:Array of npcInfo; procedure setupNPC(which,nText:string;nArea:Tbox;nAttack:boolean); var i,ii:integer; good:boolean; begin setArrayLength(npc,length(npc)+1); i:=high(npc); npc[i].text:=nText; npc[i].area:=nArea; npc[i].attack:=nAttack; repeat if rBool then begin if rBool then npc[i].x:=npc[i].area.x1+5 else npc[i].x:=npc[i].area.x2-5; npc[i].y:=randomRange(npc[i].area.y1+5,npc[i].area.y2-5); end else begin npc[i].x:=randomRange(npc[i].area.x1+5,npc[i].area.x2-5); if rBool then npc[i].y:=npc[i].area.y1+5 else npc[i].y:=npc[i].area.y2-5; end; good:=true; for ii:=0 to high(npc) do if i<>ii then if distance(npc[i].x+3,npc[i].y+7,npc[ii].x+3,npc[ii].y+7)<8 then good:=false; until(good); end; procedure killNPC(key:integer); var i,ii:integer; begin for i:=key to high(npc)-1 do begin npc[i].x:=npc[i+1].x; npc[i].y:=npc[i+1].y; npc[i].area:=npc[i+1].area; npc[i].text:=npc[i+1].text; npc[i].attack:=npc[i+1].attack; npc[i].deadTime:=npc[i+1].deadTime; npc[i].hits:=npc[i+1].hits; for ii:=0 to high(npc[i].bmps) do freeBitmap(npc[i].bmps[ii]); npc[i].bmps:=npc[i+1].bmps; // npc[i]. end; setArrayLength(npc,length(npc)-1); end; function drawExplosionOnBitmap(bmp:integer;rx,ry,size:integer;blood:boolean):integer; var ix,iy,dist:integer; begin for ix:=rx-size to rx+size do for iy:=ry-size to ry+size do begin dist:=distance(ix,iy,rx,ry); if random(dist*2)=0 then if intInBox(ix,iy,intToBox(1,1,549,399)) then begin if blood then fastSetPixel(bmp,ix,iy,RGBtoColor(255*(dist/size+1),dist*5,0)) else fastSetPixel(bmp,ix,iy,RGBtoColor(255*(dist/size+1),(255*(dist/size+1))-255,0)) end; end; result:=bmp; end; function drawGuyOnBitmap(bmp:integer;rx,ry,face:integer):integer; var guy:integer; begin case face of // up 0: guy:=BitmapFromString(7, 14, 'beNr7/x8CZjR7Q9D//+giyO' + 'JYBd/eqYWLANmYJvxHAkAFEPQfFTy6VInM9aiahowgIsjicDamIMQ' + 'oV9cZEIRsOIQLIeEAU9DNWhaIEAwAexHRfw=='); 1: guy:=BitmapFromString(7, 14, 'beNr7/x8CZjR7Q9D//ygib' + // right '+/UAhGmoJysJFwQyIWrRFaMKYJLEAgeXar8jwE8qqZhCjrldxApiN' + 'VMV9cZRAq6WcsCEYgFAO1K/O4='); 2: guy:=BitmapFromString(7, 14, 'beNr7/x8CZjR7Q9D//+giy' + // down 'OJAxts7tRAEFwSyGRgY4CTcBLjK/0gAUxkEPLpUicz1qJqGjCAiyO' + 'JwNqYgxChX1xkQhGw4hAsh4QBT0M1aFogQDADBgdKN'); 3,4: guy:=BitmapFromString(7, 14, 'beNr7/x8CZjR7Q9B/JPD2Ti' + // left '0QoYnLyUqiCUKUQQSBJJp2ZBFcgkDw6FLlfwzgUTUNU9Apv4NIQax' + 'murrOIEbQzVoWiKAcAAlb/O4='); end; { case lowercase(which) of 'zombie': begin end; end; } try SetTransparentColor(guy,clWhite); FastDrawTransparent(rx,ry,guy,bmp); result:=bmp; except writeln('oh noez!'); finally freebitmap(guy); end; end; function drawBulletOnBitmap(bmp:integer;who:integer):integer; var i,ii,mx,my,rx,ry:integer; angle:extended; brk:boolean; begin rx:=mez[who].x-random(4)+random(4)+3; ry:=mez[who].y-random(4)+random(4)+5; try angle:=arcTan2(rise,run)+(pi/2); // writeln(floatTostr(ang)); except writeln('setting using pi'); angle:=0; end; if angle<0 then angle:=angle+(2*pi); for i:=0 to mez[who].bulletDistance+random(10) do begin mx:=round(i*sin(angle))+rx; my:=round(-i*cos(angle))+ry; if intInBox(mx,my,intToBox(1,1,549,399)) then begin fastSetPixel(bmp,mx,my,clGray); for ii:=0 to high(npc) do begin if distance(mx,my,npc[ii].x+3,npc[ii].y+7)<10 then begin if npc[ii].deadTime=0 then incEx(mez[who].score,10); inc(npc[ii].hits); if npc[ii].hits>5 then begin npc[ii].deadTime:=getTickCount-5000; bmp:=drawExplosionOnBitmap(bmp,npc[ii].x+3,npc[ii].y+7,25+random(15),true); incEx(mez[who].score,25); end else begin npc[ii].deadTime:=getTickCount; bmp:=drawExplosionOnBitmap(bmp,npc[ii].x+3,npc[ii].y+7,7+random(9),true); end; brk:=true; break; end; end; if brk then break; end else break; end; result:=bmp; playsound(scriptpath+'gun.wav'); end; procedure refresh; var i,ii,f,mx,my,bmp,hud:integer; canMove:boolean; ang:extended; //canvas:Tcanvas; begin bmp:=bitmapFromString(550,400,''); FastDrawClear(bmp,clGreen); if getTickCount - lvlTime < 3000 then if lvlTxt<>'' then begin hud:=createBitmapFromText(lvlTxt, smallChars, 1048592); SetTransparentColor(hud,0); FastDrawTransparent(15,12,hud,bmp); FreeBitmap(hud); end; for i:=0 to high(mez) do if (mez[i].x>=0) and (mez[i].x<=550) then if (mez[i].y>=0) and (mez[i].y<=400) then begin if not((mez[i].x=mez[i].lp.x)and(mez[i].y=mez[i].lp.y)) then begin rise:=mez[i].y-mez[i].lp.y; run:=mez[i].x-mez[i].lp.x; mez[i].lp.x:=mez[i].x; mez[i].lp.y:=mez[i].y; end; if (rise<0) then f:=0 else if (rise>0) then f:=2 else if run>0 then f:=1 else if run<0 then f:=3; bmp:=drawGuyOnBitmap(bmp,mez[i].x,mez[i].y,f); if mez[i].shoot then begin bmp:=drawBulletOnBitmap(bmp,i); bmp:=drawExplosionOnBitmap(bmp,mez[i].x+5,mez[i].y+8,2,false); mez[i].shoot:=false; mez[i].shootTime:=getTickCount; end; end; for i:=0 to high(npc) do begin if npc[i].deadTime>0 then begin try if getTickCount-npc[i].deadTime>1500+random(1000) then killNPC(i); bmp:=drawGuyOnBitmap(bmp,npc[i].x,npc[i].y,2); except // writeln('zombie was already dead!'); end; continue; end; try for ii:=0 to high(mez) do if distance(mez[ii].x,mez[ii].y,npc[i].y,npc[i].x)< distance(mez[npc[i].target].x,mez[npc[i].target].y,npc[i].y,npc[i].x) then if iabs(distance(mez[ii].x,mez[ii].y,npc[i].y,npc[i].x)- distance(mez[npc[i].target].x,mez[npc[i].target].y,npc[i].y,npc[i].x))>10 then npc[i].target:=ii; ang:=arcTan2(mez[npc[i].target].y-npc[i].y,mez[npc[i].target].x-npc[i].x)+(pi/2); // writeln(floatTostr(ang)); except writeln('setting as pi'); ang:=pi; end; if ang<0 then ang:=ang+(2*pi); mx:=npc[i].x+round(speed*sin(ang)); my:=npc[i].y+round(-speed*cos(ang)); if intInBox(mx,my,intToBox(1,1,549,399)) then begin for ii:=0 to high(mez) do if distance(mx+3,my+7,mez[ii].x+3,mez[ii].y+7)<5 then begin dec(mez[ii].hp); if mez[ii].hp<=0 then begin mez[ii].hp:=0; hud:=createBitmapFromText('You Are Dead', npcChars, clRed); SetTransparentColor(hud,0); FastDrawTransparent(215,165,hud,bmp); FreeBitmap(hud); wait(1500); break; end; end; canMove:=true; for ii:=0 to high(npc) do if i<>ii then if npc[ii].deadTime=0 then if distance(mx+3,my+7,npc[ii].x+3,npc[ii].y+7)<8 then begin canMove:=false; break; end; if canMove then begin npc[i].x:=mx; npc[i].y:=my; end; end; bmp:=drawGuyOnBitmap(bmp,npc[i].x,npc[i].y,round(ang div (pi/2))); end; hud:=createBitmapFromText('Health: '+inttostr(mez[0].hp)+'% Score: '+inttostr(mez[0].score), upChars, clWhite); SetTransparentColor(hud,0); FastDrawTransparent(15,375,hud,bmp); FreeBitmap(hud); try // SafeDrawBitmap(bmp,gameLayer.canvas,0,0); safeCopyCanvas(GetBitmapCanvas(bmp),frmdesign.canvas,0,0,550,400,0,0,550,400); except writeln('couldnt copy canvas'); end; freeBitMap(bmp); end; procedure SafeRefresh; var v: TVariantArray; begin SetArrayLength(v, 0); ThreadSafeCall('refresh', v); end; function isKeyPressed(thebyte:integer):boolean; begin case thebyte of 38: result:=isArrowDown(0); 39: result:=isArrowDown(1); 40: result:=isArrowDown(2); 37: result:=isArrowDown(3); 16: result:=isFunctionKeyDown(0); 17: result:=isFunctionKeyDown(1); 18: result:=isFunctionKeyDown(2); else result:=isKeyDown(chr(thebyte)); end; end; procedure scriptTerminate; begin getSelf.WindowState:=wsNormal; end; procedure playGame(mode:string;num,fps:integer); var i:integer; tmp:char; begin try frmDesign.BorderStyle := bsNone; setArrayLength(mez,num); for i:=0 to high(mez) do begin mez[i].x:=100+random(200); mez[i].y:=100+random(150); mez[i].hp:=100; mez[i].score:=0; mez[i].speed:=3; mez[i].shoot:=false; mez[i].bulletDistance:=60; mez[i].rapidFire:=false; mez[i].explosives:=false; mez[i].level:=0; end; speed:=1; amount:=0; repeat if length(npc)=0 then begin incEx(amount,2); if amount>25 then begin amount:=2; inc(speed); end; for n:=0 to amount do setupNPC('zombie','',inttobox(0,0,550,400),true); end; try inc(rr); if rr mod 2 = 0 then begin safeRefresh; rr:=0; end; except writeln('error refreshing'); end; for i:=0 to high(mez) do begin case mez[i].level of 0: if mez[i].score>=100 then begin inc(mez[i].level); mez[i].bulletDistance:=100; lvltxt:='player '+inttostr(i+1)+' levled up +1 bullet distance'; lvltime:=getTickCount; end; 1: if mez[i].score>=500 then begin inc(mez[i].level); inc(mez[i].speed); lvltxt:='player '+inttostr(i+1)+' levled up +1 speed'; lvltime:=getTickCount; end; 2: if mez[i].score>=1000 then begin inc(mez[i].level); mez[i].explosives:=true; lvltxt:='player '+inttostr(i+1)+' levled up +explosives'; lvltime:=getTickCount; end; 3: if mez[i].score>=2500 then begin inc(mez[i].level); mez[i].bulletDistance:=150; lvltxt:='player '+inttostr(i+1)+' levled up +1 bullet distance'; lvltime:=getTickCount; end; 4: if mez[i].score>=5000 then begin inc(mez[i].level); inc(mez[i].speed); lvltxt:='player '+inttostr(i+1)+' levled up +1 speed'; lvltime:=getTickCount; end; 5: if mez[i].score>=10000 then begin inc(mez[i].level); inc(mez[i].speed); lvltxt:='player '+inttostr(i+1)+' levled up +1 speed'; lvltime:=getTickCount; end; 6: if mez[i].score>=15000 then begin inc(mez[i].level); mez[i].bulletDistance:=200; lvltxt:='player '+inttostr(i+1)+' levled up +1 bullet distance'; lvltime:=getTickCount; end; 7: if mez[i].score>=20000 then begin inc(mez[i].level); inc(mez[i].speed); lvltxt:='player '+inttostr(i+1)+' levled up +1 speed'; lvltime:=getTickCount; end; 8: if mez[i].score>=30000 then begin inc(mez[i].level); mez[i].hp:=100; lvltxt:='player '+inttostr(i+1)+' levled up +Life Restored'; lvltime:=getTickCount; end; 9: if mez[i].score>=50000 then begin inc(mez[i].level); mez[i].rapidFire:=true; lvltxt:='player '+inttostr(i+1)+' levled up +rapid fire'; lvltime:=getTickCount; end; end; if mez[i].hp<=0 then // fix this for multiplayer begin wait(4000); exit; end; end; if isKeyDown('p') then begin repeat wait(100); until(not(isKeyDown('p'))); repeat wait(100); until(isKeyDown('p')); repeat wait(100); until(not(isKeyDown('p'))); end; // 0 = up, 1 = right, 2 = down, 3 = left. for i:=0 to high(mez) do begin // writeln(inttostr(ctrl[i][4])); if IsKeyPressed(ctrl[i][0]) then if (mez[i].y>0) then decex(mez[i].y,mez[i].speed); if IsKeyPressed(ctrl[i][1]) then if (mez[i].x<550) then incex(mez[i].x,mez[i].speed); if IsKeyPressed(ctrl[i][2]) then if (mez[i].y<400) then incex(mez[i].y,mez[i].speed); if IsKeyPressed(ctrl[i][3]) then if (mez[i].x>0) then decex(mez[i].x,mez[i].speed); if getTickCount - mez[i].shootTime > 100 then if isKeyPressed(ctrl[i][4]) then mez[i].shoot:=true; end; wait(25); until(isFKeyDown(1)); repeat wait(100) until(not(isFKeyDown(1))); except writeln('Error: Game Could Not Run'); finally // gameLayer.visible := false; setArrayLength(npc,0); setArrayLength(mez,0); frmDesign.BorderStyle := bsSingle; end; end; procedure fade; var i,tmpbmp,color:integer; begin tmpbmp:=bitmapfromstring(550,400,''); FastDrawClear(tmpbmp,255); SafeCopyCanvas(GetBitmapCanvas(tmpBmp), frmdesign.canvas, 0, 0, 550, 400, 0, 0, 550, 400); wait(50); i:=255; repeat color:=rgbtocolor(i,i,i); FastDrawClear(tmpbmp,color); SafeCopyCanvas(GetBitmapCanvas(tmpBmp), frmdesign.canvas, 0, 0, 550, 400, 0, 0, 550, 400); wait(100); i:=i-20; until(i<=0); freebitmap(tmpbmp); end; procedure loadSettings; var i,ii:integer; tmpStr:string; begin for i:=0 to 3 do for ii:=0 to 4 do ctrl[i][ii]:=strtointdef(ReadINI(inttostr(i),inttostr(ii),scriptpath+'mrzsettings.ini'),0); if ctrl[0][0]=0 then // set defaults begin ctrl[0][0]:=38; ctrl[0][1]:=39; ctrl[0][2]:=40; ctrl[0][3]:=37; ctrl[0][4]:=32; end; end; procedure clickOption(sender:Tobject); var i,ii:integer; begin for i:=0 to high(options) do if sender=options[i] then begin case i of 0: begin // panel1.visible :=false; fade; wait(1000); playGame('survival',1,0); end; 1: begin fade; wait(1000); playGame('survival',2,0); end; 2: begin for ii:=0 to 3 do options[ii].visible:=false; options[4].visible :=true; for ii:=0 to 4 do controls[ii].visible:=true; for ii:=0 to 5 do optLabel[ii].visible:=true; ComboBox1.visible:=true; cc:=0; end; 3: frmDesign.modalresult := mrOk; 4: begin for ii:=0 to 3 do options[ii].visible:=true; options[4].visible :=false; for ii:=0 to 4 do controls[ii].visible:=false; for ii:=0 to 5 do optLabel[ii].visible:=false; ComboBox1.visible:=false; end; end; exit; end; end; function getKeyText(key:integer):string; begin case key of 32: result:='SPACE'; 16: result:='SHIFT'; 17: result:='CTRL'; 18: result:='ALT'; 38: result:='UP'; 39: result:='RIGHT'; 40: result:='DOWN'; 37: result:='LEFT'; else result:=chr(key); end; end; procedure recordControl(Sender: TObject; var Key: Word; Shift: TShiftState); var i:integer; begin for i:=0 to high(controls) do if sender = controls[i] then begin if inrange(key,65,90) then key:=key+32; WriteINI(inttostr(cc),inttostr(i),inttostr(key),scriptpath+'mrzsettings.ini'); controls[i].text:=GetKeyText(key); ctrl[cc][i]:=key; writeln(inttostr(Key)); exit; end; writeln('no keycode found'); end; procedure changeControl(Sender: TObject); var i:integer; begin cc:=strToIntDef(comboBox1.text,1)-1; for i:=0 to 4 do controls[i].text:=getKeyText(ctrl[cc][i]); end; procedure hovering(Sender: TObject; Shift: TShiftState; X, Y: Integer); var i:integer; begin if sender=frmDesign then begin for i:=0 to high(options) do options[i].Font.Color := 15132390; end else begin for i:=0 to high(options) do if options[i]=sender then options[i].Font.Color := clred; end; end; procedure mrzForm; var topbmp:integer; begin frmDesign := CreateForm; frmDesign.Left := 250; frmDesign.Top := 114; frmDesign.BorderStyle := bsSingle; frmDesign.Caption := 'These ain'#39't no ordinary zombies....'; frmDesign.ClientHeight := 375; frmDesign.ClientWidth := 544; frmDesign.Color := clBlack; frmDesign.Font.Color := clWindowText; frmDesign.Font.Height := -11; frmDesign.Font.Name := 'MS Sans Serif'; frmDesign.Font.Style := []; frmDesign.Visible := false; frmDesign.PixelsPerInch := 96; frmDesign.OnMouseMove := @hovering; title := TLabel.Create(frmDesign); title.Parent := frmDesign; title.Left := 50; title.Top := 12; title.Width := 454; title.Height := 41; title.Caption := 'Murderous Raping Zombies'; title.Color := clBlack; title.Font.Color := clwhite; title.Font.Height := -20; title.Font.Name := 'Arial Black'; title.Font.Style := [fsBold]; watermark := TLabel.Create(frmDesign); watermark.Parent := frmDesign; watermark.Left := 503; watermark.Top := 357; watermark.Width := 454; watermark.Height := 41; watermark.Caption := 'munk'; watermark.Color := clBlack; watermark.Font.Color := 4813601; watermark.Font.Height := -8; watermark.Font.Name := 'Courier'; { Bevel1 := TBevel.Create(frmDesign); Bevel1.Parent := frmDesign; Bevel1.Left := 400; Bevel1.Top := 140; Bevel1.Width := 120; Bevel1.Height := 100; Bevel1.Style := bsRaised; } { Panel1 := TPanel.Create(frmDesign); Panel1.Parent := frmDesign; Panel1.ParentColor := true; Panel1.Left := 400; Panel1.Top := 140; Panel1.Width := 120; Panel1.Height := 100; Panel1.Caption := ''; Panel1.TabOrder := 8; } { hiscorestitle := TLabel.Create(frmDesign); hiscorestitle.Parent := panel1; hiscorestitle.Left := 27; hiscorestitle.Top := 10; hiscorestitle.Width := 454; hiscorestitle.Height := 41; hiscorestitle.Caption := 'HighScores'; hiscorestitle.Color := clBlack; hiscorestitle.Font.Color := 1381783; hiscorestitle.Font.Height := -12; hiscorestitle.Font.Name := 'Arial'; hiscorestitle.Font.Style := [fsBold]; } setArrayLength(options,5); options[0] := TLabel.Create(frmDesign); options[0].Parent := frmDesign; options[0].Left := 155; options[0].Top := 136; options[0].Width := 454; options[0].Height := 41; options[0].Caption := 'Survival'; options[0].Color := clBlack; options[0].Font.Color := 15132390; options[0].Font.Height := -14; options[0].Font.Name := 'Arial Black'; options[0].ParentColor := False; options[0].ParentFont := False; options[0].OnMouseMove := @hovering; options[0].OnClick := @clickOption; options[1] := TLabel.Create(frmDesign); options[1].Parent := frmDesign; options[1].Left := 155; options[1].Top := 166; options[1].Width := 454; options[1].Height := 41; options[1].Caption := 'Multiplayer'; options[1].Color := clBlack; options[1].Font.Color := 15132390; options[1].Font.Height := -14; options[1].Font.Name := 'Arial Black'; options[1].ParentColor := False; options[1].ParentFont := False; options[1].OnClick := @clickOption; options[1].OnMouseMove := @hovering; options[2] := TLabel.Create(frmDesign); options[2].Parent := frmDesign; options[2].Left := 155; options[2].Top := 196; options[2].Width := 454; options[2].Height := 41; options[2].Caption := 'Options'; options[2].Color := clBlack; options[2].Font.Color := 15132390; options[2].Font.Height := -14; options[2].Font.Name := 'Arial Black'; options[2].ParentColor := False; options[2].ParentFont := False; options[2].OnMouseMove := @hovering; options[2].OnClick := @clickOption; options[3] := TLabel.Create(frmDesign); options[3].Parent := frmDesign; options[3].Left := 155; options[3].Top := 246; options[3].Width := 454; options[3].Height := 41; options[3].Caption := 'Exit'; options[3].Color := clBlack; options[3].Font.Color := 15132390; options[3].Font.Height := -14; options[3].Font.Name := 'Arial Black'; options[3].ParentColor := False; options[3].ParentFont := False; options[3].OnMouseMove := @hovering; options[3].OnClick := @clickOption; options[4] := TLabel.Create(frmDesign); options[4].Parent := frmDesign; options[4].Left := 155; options[4].Top := 330; options[4].Width := 454; options[4].Height := 41; options[4].Caption := 'Back'; options[4].Color := clBlack; options[4].Font.Color := 15132390; options[4].Font.Height := -14; options[4].Font.Name := 'Arial Black'; options[4].ParentColor := False; options[4].ParentFont := False; options[4].OnMouseMove := @hovering; options[4].OnClick := @clickOption; options[4].visible :=false; setArrayLength(controls,5); controls[0] := TEdit.Create(frmDesign); controls[0].Parent := frmDesign; controls[0].Left := 140; controls[0].Top := 125; controls[0].Width := 40; controls[0].Height := 21; controls[0].TabOrder := 8; controls[0].onKeyUp:= @recordControl; controls[0].visible:=false; if ctrl[cc][0]>=0 then controls[0].Text := getKeyText(ctrl[cc][0]) else controls[0].Text := ''; controls[1] := TEdit.Create(frmDesign); controls[1].Parent := frmDesign; controls[1].Left := 200; controls[1].Top := 165; controls[1].Width := 40; controls[1].Height := 21; controls[1].TabOrder := 8; controls[1].Text := ''; controls[1].onKeyUp:= @recordControl; controls[1].visible:=false; if ctrl[cc][1]>=0 then controls[1].Text := getKeyText(ctrl[cc][1]) else controls[1].Text := ''; controls[2] := TEdit.Create(frmDesign); controls[2].Parent := frmDesign; controls[2].Left := 140; controls[2].Top := 205; controls[2].Width := 40; controls[2].Height := 21; controls[2].TabOrder := 8; controls[2].Text := ''; controls[2].onKeyUp:= @recordControl; controls[2].visible:=false; if ctrl[cc][2]>=0 then controls[2].Text := getKeyText(ctrl[cc][2]) else controls[2].Text := ''; controls[3] := TEdit.Create(frmDesign); controls[3].Parent := frmDesign; controls[3].Left := 80; controls[3].Top := 165; controls[3].Width := 40; controls[3].Height := 21; controls[3].TabOrder := 8; controls[3].Text := ''; controls[3].onKeyUp:= @recordControl; controls[3].visible:=false; if ctrl[cc][3]>=0 then controls[3].Text := getKeyText(ctrl[cc][3]) else controls[3].Text := ''; controls[4] := TEdit.Create(frmDesign); controls[4].Parent := frmDesign; controls[4].Left := 250; controls[4].Top := 205; controls[4].Width := 40; controls[4].Height := 21; controls[4].TabOrder := 8; controls[4].Text := ''; controls[4].onKeyUp:= @recordControl; controls[4].visible:=false; if ctrl[cc][4]>=0 then controls[4].Text := getKeyText(ctrl[cc][4]) else controls[4].Text := ''; ComboBox1 := TComboBox.Create(frmDesign); ComboBox1.Parent := frmDesign; ComboBox1.Left := 200; ComboBox1.Top := 96; ComboBox1.Width := 35; ComboBox1.Height := 21; ComboBox1.ItemHeight := 13; ComboBox1.TabOrder := 8; ComboBox1.Text := '1'; ComboBox1.Items.Add('1'); ComboBox1.Items.Add('2'); ComboBox1.Items.Add('3'); ComboBox1.Items.Add('4'); ComboBox1.OnChange:=@changeControl; ComboBox1.visible:=false; setArrayLength(optLabel,6); optLabel[0] := TLabel.Create(frmDesign); optLabel[0].Parent := frmDesign; optLabel[0].Left := 96; optLabel[0].Top := 96; optLabel[0].Width := 100; optLabel[0].Height := 17; optLabel[0].Caption := 'Player Controls'; optLabel[0].Font.Color := clWhite; optLabel[0].Font.Height := -15; optLabel[0].Font.Name := 'Arial'; optLabel[0].Font.Style := []; optLabel[0].ParentFont := False; optLabel[0].visible := false; optLabel[1] := TLabel.Create(frmDesign); optLabel[1].Parent := frmDesign; optLabel[1].Left := 152; optLabel[1].Top := 150; optLabel[1].Width := 11; optLabel[1].Height := 14; optLabel[1].Caption := 'Up'; optLabel[1].Font.Color := clSilver; optLabel[1].Font.Height := -11; optLabel[1].Font.Name := 'Times New Roman'; optLabel[1].Font.Style := []; optLabel[1].ParentFont := False; optLabel[1].visible := false; optLabel[2] := TLabel.Create(frmDesign); optLabel[2].Parent := frmDesign; optLabel[2].Left := 170; optLabel[2].Top := 168; optLabel[2].Width := 25; optLabel[2].Height := 14; optLabel[2].Caption := 'Right'; optLabel[2].Font.Color := clSilver; optLabel[2].Font.Height := -11; optLabel[2].Font.Name := 'Times New Roman'; optLabel[2].Font.Style := []; optLabel[2].ParentFont := False; optLabel[2].visible := false; optLabel[3] := TLabel.Create(frmDesign); optLabel[3].Parent := frmDesign; optLabel[3].Left := 146; optLabel[3].Top := 188; optLabel[3].Width := 24; optLabel[3].Height := 14; optLabel[3].Caption := 'Down'; optLabel[3].Font.Color := clSilver; optLabel[3].Font.Height := -11; optLabel[3].Font.Name := 'Times New Roman'; optLabel[3].Font.Style := []; optLabel[3].ParentFont := False; optLabel[3].visible := false; optLabel[4] := TLabel.Create(frmDesign); optLabel[4].Parent := frmDesign; optLabel[4].Left := 128; optLabel[4].Top := 168; optLabel[4].Width := 20; optLabel[4].Height := 14; optLabel[4].Caption := 'Left'; optLabel[4].Font.Color := clSilver; optLabel[4].Font.Height := -11; optLabel[4].Font.Name := 'Times New Roman'; optLabel[4].Font.Style := []; optLabel[4].ParentFont := False; optLabel[4].visible := false; optLabel[5] := TLabel.Create(frmDesign); optLabel[5].Parent := frmDesign; optLabel[5].Left := 216; optLabel[5].Top := 208; optLabel[5].Width := 20; optLabel[5].Height := 14; optLabel[5].Caption := 'Shoot'; optLabel[5].Font.Color := clSilver; optLabel[5].Font.Height := -11; optLabel[5].Font.Name := 'Times New Roman'; optLabel[5].Font.Style := []; optLabel[5].ParentFont := False; optLabel[5].visible := false; { Button1 := TButton.Create(frmDesign); Button1.Parent := frmDesign; Button1.Left := 0; Button1.Top := 0; Button1.Width := 1; Button1.Height := 1; Button1.Caption := ''; Button1.TabOrder := 8; button1.OnEnter:=@intro; } topbmp := BitmapFromString(28, 44, 'beNrFl1uoVVUUhr9xtqZGIqXHS' + 'Cj0wcoCI0uixG6UBZkl0d0iyygrIoIiw8ySzF4krJAwu5BJJN3LUr' + 'I008xrmlYqKQrd7PpQ0IWysb7dlAM7Pfuhcxx8D+vMPee/1pzzH2P' + 'OA+3GETCozZ8hfaBL+0PpBidCd+kKrRH19gmwFPpKxgmyE87eT5oD' + 'YBsMk1tgOxxfqyUTI3bDtZJxq2TLeU1oHgW/wExZ46ipcqfP90rGm' + '7LbV+8Xzd6wA9bLakfNk4k+PyA1+Eyy5RSaikXwlSxy1GZ5xOfJ0g' + 'o/Srac3JzmbPhDXnXUT/Kiz/dIf/hd/tQk9eirXTtTc4bDk9fhh6K' + '/oM3ch5YOv8HgMmoWvANHS2M8VIakybfC3/J2Gw9cWDp8D0eWUW/4' + 'AXXfdi+ZsifuLkM+gQ3wlzytx6bI5fCrzDPdDpFlLtHj0topmjcQ9' + 'flu0fY/y2Qd9YLk7NbKBPtfI1/D52UTezRoXkbsgl1qfmj6b7Pn2m' + 'L1J2GJjIZeMF++gxVwgTRGR2ieSdRz51N4V9nkMTV3SDYulxEwpjS' + 'uc1mGSmOcTtS/JxfzFZ25QM+vLzm73J+Si+Auq+hOvZRlsIc0xghi' + 'S5n4XFgo7+mBb2V1KTJZYG8sz9nzDGiRztEcSWw1gz6AObBYVrq8e' + 'zTXyTS4BJ6Vh9vkaWNcXL4zc/MpYpl+3uSu1f2QK/mRpAFGwXVyPR' + 'zWYMuO08zWS4mNsFHNZ4hVsMpX5Ny/kTX+tNTcHF38M8Q8/c9oqTx' + 'frd5KXT2H2ODufKGlv5Rcz7fkJbjCo3aA5t/bzGu+ur7XS6rd/Ner' + 'm92v7bKm+v6KGdaTQ6Vl7xvUEZp59zgHnpPFVbrFJllPTCrp87Fqy' + 'ZVwlkdt730ecF08CqfLQjU3yPvE2CoBI0nZB+VY7wM9JTpd82hvHc' + 'lrlVtihbxMnAtPSBaoSZIH5cFe27q1p9m/lO7clOeJ+TI7YnhV7SN' + 'Jm90uB9q/JvvW7FOlfMVMPT/X+jAt4rgqWSLJ+nmTHKBau9ERmjUz' + 'YrhMrQ7BeBSSOyIGWbJGurbjYJya0ZxmT6vWYGv4dOJ+SMZGrnOcJ' + 'LM8MsZo5mY0W9zEgTIe7oPb5PyIfuXqMoUYZUXqsl81c5X6ydWVS+' + 'MqSE6LyAQ8XG4uF/5a05pdvbW2etcaXzwwJOKgktpZZI6RaO5C20G' + 'adTv18n+fnPWpMjCqMl5vH1YWoUnN/y3+AXUDnhg='); topImg := TImage.Create(frmDesign); topImg.Parent := frmDesign; topImg.SetBounds(0, 0, 28, 44); SafeCopyCanvas(GetBitmapCanvas(topBmp), topImg.Canvas, 0, 0, 28, 44, 0, 0, 28, 44); topImg.Left := 15; topImg.Top := 15; topImg.Width := 28; topImg.Height := 44; freebitmap(topbmp); end; procedure SafeInitForm; var v: TVariantArray; begin SetArrayLength(v, 0); ThreadSafeCall('mrzForm', v); end; procedure ShowFormModal; begin frmDesign.ShowModal; end; procedure SafeShowFormModal; var v: TVariantArray; begin SetArrayLength(V, 0); ThreadSafeCall('ShowFormModal', v); end; begin // getSelf.WindowState:=wsMinimized; loadSettings; safeInitForm; SafeShowFormModal; FreeForm(frmDesign); end. { }