SRL Archive - OSR Help

Bitmap variable problem.


Littma

2010-01-26 12:50:38

Update:

Alright, I believe this is my last problem.


procedure FireRain;
var i, fire, bandage : Integer;
begin
repeat
Wait(2 * 250+random(50));
Writeln('Casting Fire Rain.');
if FindBitmap(fire, x, y) then
MoveMouseSmooth(x, y);
HoldMouse(x, y, True);
Wait(2 * 500+random(50));
ReleaseMouse(x, y, True);
Wait(6 * 1500+random(50));
Writeln('Healing with Bandage.');
if FindBitmap(bandage, x, y) then;
MoveMouseSmooth(x, y);
Wait(2 * 150+random(50));
ClickMouse(x, y, True);
Wait(2 * 2000+random(50));
Inc(i);
until(i = 10);
end;
I can see what's wrong here where it will not do the bandage command after the fire rain command.
I tried fixing the problem by using this.


procedure FireRain;
var i, fire, bandage : Integer;
begin
repeat
Wait(2 * 250+random(50));
Writeln('Casting Fire Rain.');
if FindBitmap(fire, x, y) then
MoveMouseSmooth(x, y);
HoldMouse(x, y, True);
Wait(2 * 500+random(50));
ReleaseMouse(x, y, True);
Wait(6 * 1500+random(50));
end;
begin
Writeln('Healing with Bandage.');
if FindBitmap(bandage, x, y) then;
MoveMouseSmooth(x, y);
Wait(2 * 150+random(50));
ClickMouse(x, y, True);
Wait(2 * 2000+random(50));
Inc(i);
until(i = 10);
end;
end;
Though returns with this error

Line 103: [Error] (103:1): Identifier expected in script
Which is the 'end;' after 'Wait(6 * 1500+random(50));'
Any ideas? ^^

Gu3st...

2010-01-26 12:55:06

You can't have a variable inside a procedure that has the same name as the procedure.
Rename the bitmap to bandage2 or the procedure to bandage2 and it will work

Frement

2010-01-26 12:55:37

From: Zyt3x
You can't have a variable inside a procedure that has the same name as the procedure.
Rename the bitmap to bandage2 or the procedure to bandage2 and it will work


Still the script has multiple flaws.

Littma

2010-01-26 12:56:47

From: Zyt3x
You can't have a variable inside a procedure that has the same name as the procedure.
Rename the bitmap to bandage2 or the procedure to bandage2 and it will work


Indeed, you are right.
What would I do without you :D

From: Frement
Still the script has multiple flaws.

Elaborate? I do see how the mousing could get messed up when finding the bitmaps, any advice?

Frement

2010-01-26 12:57:18

From: Littma
Indeed, you are right.
What would I do without you :D


Elaborate? I do see how the mousing could get messed up when finding the bitmaps, any advice?


program zOMGbotBETA;

var i, x, y, teflon, bitmap : Integer;
fire, bandage, divinity : Integer;
sphere : Integer;

procedure LoadBitmaps;
begin
fire := BitmapFromString(16, 12, 'beNpNkV1I0wEUxX9t2txg/+na' +
'FN3a5iCRSW5gpYwKyxIibA/2VERhIqyICIqKQUREhVpuWcqcE/yoI' +
'VNIRbJI+6AJg0W++JQPrZIK+vAhqAi5/bWIDufhwj3n3nO5Jt7scY' +
'7CfCUyWS9h23s/2TKS8LmxSC6YZLymt4RuE1MbkbbKb8dLonp6DCw' +
'dtchgpYQMPw4UD+uZr0cueT8eLJgqZ9DEqAu5aZfrjsQGTkCfXfVW' +
'ydmCbIChIl7sRm54pN2XKKRHy4AZCTklsSW9nyu5nDKibpTTjuVm1' +
'7iLV4eQuFvaHYkKOnLpK2QxiCQ3L53zhNfRmsNJC8vny+SYZdzCUx' +
'8y6JC4OXuELoWhUl63FMj9WomUx+xcy6HTzPfIVrnonXEz40Au22T' +
'AKh3Ks1IeFfOyEZneIYmGEQ+da+kykA4Qqss/41MCOcz51djrpcf5' +
'qXlNSs+Can++Tx5uv+clrOEqxHSkapFMVCWrkFi1tNVOW3lr4qt6V' +
'H/DEx9xPd2QyDPeYqXIRKsk0/LHIrFNi3uts2bmNSwofNjJ3DYkuO' +
'uxu3jUaOyHB1r+Tl7V/wxpfzU5p82klLwxHWMVSK9/qck3YdfF4a7' +
'6Vqf+f72KTA1TFpIGxtQ84bp3QVtM4Tao7VlXftq6kucfVX1Ez7CJ' +
'SfuK+Mvh6gi0woiiuZPLEMz8Bp9d0Q4=');
bandage := BitmapFromString(14, 10, 'beNo9zM0vw3AAxnF/iT/Bh' +
'ZC4uRNOSCQOIi7inVAmi4uXhIWglBjd1lnbdVsXHSPzErLMWrq2W7' +
'PZZjhIvMTYRruR/TSW+OY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2VPcHS8uad+7U8MyfbNi+q5txC7flL07IZJ3gxfY/TX3z5Aw' +
'3ns9g=');
teflon := BitmapFromString(15, 15, 'beNo90MlrE2EYBnD/Ai8qQV' +
'DxItqoFY1ibRNMDdUszb42k8xMFpNMZkkySSaZyWSPTWvSlJqLKdX' +
'QQ0V6EU8ePCgILhBPnmoPIh6KUItHBWF820E/Xj7m8Hsfnm+2v3/7' +
'LW28fE/We83BExgs3whk6yqj74zaqBhXHzt/46Rq+vgljeLilEI5w' +
'XVXSyuPiWoX55rp+T7TWkHzzTsodeqaDjDIE1e0R8auA1Zbg0R1KX' +
'XvQVRoo7k6xMLtz1SDuYYtnr+gsx9VToBUai2uZBFhxAjfBhkTF0E' +
'GszXACFuDCfNtc5SdDaf1KGUKpcyRDMbW4uVOhJ9PVDqhQgs+AEMN' +
'NyXAQHl/ujKXKoN0EoVSby1R6YKEcOgcYKuuZAFqAPMyIngwEOulS' +
'zMIcXZSf1mtu3pzRq7hJov+dNlBFJzJIqzA7aEEWWo90VCuIY0Ghw' +
'4O1PDSAqzYExxISHaRvAGjjTjjSHA410qUFqVRTPbQZC4lWu+ycDc' +
'ebmD5JlSFnwA1fKRAVpZuuSPAZCwuP4oLCz6S760/6ww3bZGMPcrC' +
'WMNpA0KYgiTMfwxne+/P609ff0qSNUQbkLgZI2/7YhprcBaldO6I2' +
'hIYDVTyAK7113cl6fPuL6bWdcVYWAH2bmtn2hk6fHr83KT+H95Pfr' +
'u1sydJ+XZ/48UbotQ2BQkIhA4fv/wYmzJEudbBA2OD2D5m6st4tm7' +
'BKTQt1vtDLFNG6JInwd1f21xYfap14HKyjDU21IwzOndI60D9VNEd' +
'z5oxOsCIw+ev+M7gw1/lVhrk');
sphere := BitmapFromString(16, 16, 'beNo9z11MUnEYBvC/iCio82' +
'OrprZZdtEsXVpzrbxotrWumm1d19pabn3MavMjP9eMTEOxY4mBaJr' +
'SVCxCW9PM1EQpPAgeOYiCH8BARVHwIJYhbySrZ+/l73m2N3WsNmiu' +
'jmXEGHO5wZ925UB2Ocz1zq3X8EsKnnGwz4FpzmVf3LFqKRvpMak8f' +
'IatMWKjAhnY+8Y9A0AIl6zYuqcZNt8AjMKGlnKY1xyGZWrWvqZaXV' +
'FSohC7kG6pQvPFLNmOFKztXgtGuYVerwRcfbsuYosyONbIlQ3SQZH' +
'bTsLbgXRNaLKJZS2gDYmu6GEQlgQwW726IXbbup2WPteWBtx6cOrA' +
'oQHbOPQEzXQzF3kB02wmfj+sU3rNBD1gEniNreu6FpNbBtPvtk0ys' +
'E2B4RvYccDQUA0a4SCcjb6XMgbywz6ILy0ADktiIBotC52ba1/B6G' +
'sNgVML5Hu4gG5ksrI5gapymqoEyfNoA6Uxw6LLCyCD5Xb4/Rk2ewF' +
'IICUwgFH1VycA56O95KMfBYFTRSztnaDhorjRVxnq5TqgmkD/DGxt' +
'wMtU1WYouKlywLP8lVykKKRpH9KnS8LJwkhFbkRfflT3o2gp51C/p' +
'Rx4Z1TcRCU/ecYn/T4PycsQURagZtOV5WGqyhjyeaxaFKfuTdGtF0' +
'NjmqIuaZ6TMP/f+1JB13AYU4/RWE3IZAWTqA2dbAtXSOLk1tue5pN' +
'yTjz5IsmO80/5z+cL0QQ3wsBlaBrC9YLgmY6oeXHkhDLdSuVDU8qo' +
'MNn49ODsP7+3z9RWhmiqApXCULItRCfdv/jlmFmSpP5ZCdjx/qoEJ' +
'TuW2Ps3i5/11wujZ/hRJC9c2RW/KDlg6D1qrYsbE19cWMaAd34cS9' +
'NyEnX+fb9/Ga1oODJVfRhvOWt8e86qfgDGeljqAL0I7p3+mJM09OQ' +
'E4ZP+80Vx3UuUAi6A/lbobIWREci5a86+qVPKQITBrfTB3D8vGdKo' +
'');
end;

procedure FireRain;
begin
repeat
Wait(2 * 250+random(50));
Writeln('Casting Fire Rain.');
FindBitmapToleranceIn(bitmap, x, y, 0, 0, 436, 539, 1);
MoveMouseSmooth(x, y)
HoldMouse(x, y, True);
Wait(2 * 500+random(50));
ReleaseMouse(x, y, True);
Wait(6 * 1500+random(50));
Writeln('Healing with Bandage.');
FindBitmapToleranceIn(bitmap, x, y, 0, 0, 491, 540, 1);
MoveMouseSmooth(x, y)
Wait(2 * 150+random(50));
ClickMouse(x, y, True);
Wait(2 * 2000+random(50));
Inc(i);
until(i = 10);
end;

procedure BandageProc;
begin
repeat
Wait(2 * 500+random(50));
Writeln('Healing with Bandage.');
FindBitmapToleranceIn(bitmap, x, y, 0, 0, 491, 540, 1);
MoveMouseSmooth(x, y)
Wait(2 * 150+random(50));
ClickMouse(x, y, True);
Wait(2 * 2000+random(50));
Inc(i);
until(i = 1);
end;

procedure DivinityProc;
begin
Wait(2 * 500+random(50));
Writeln('Casting Divinity.');
FindBitmapToleranceIn(bitmap, x, y, 0, 0, 577, 540, 1);
MoveMouseSmooth(x,y)
HoldMouse(x, y, True);
Wait(2 * 1000+random(50));
ReleaseMouse(x, y, True);
Wait(2 * 2500+random(50));
end;

procedure TeflonSpray;
begin
Wait(2 * 250+random(50));
Writeln('Casting Teflon Spray.');
FindBitmapToleranceIn(bitmap, x, y, 0, 0, 604, 540, 1);
MoveMouseSmooth(x,y)
HoldMouse(x, y, True);
Wait(2 * 1000+random(50));
ReleaseMouse(x, y, True);
Wait(2 * 1000+random(50));
end;

procedure SphereProc;
begin
Wait(2 * 250+random(50));
Writeln('Casting Sphere');
FindBitmapToleranceIn(bitmap, x, y, 0, 0, 630, 537, 1);
MoveMouseSmooth(x, y)
HoldMouse(x, y, True);
Wait(2 * 1000+random(50))
ReleaseMouse(x, y, True);
Wait(2 * 1000+random(50));
end;

begin
LoadBitmaps;
repeat
FireRain;
DivinityProc;
FireRain;
TeflonSpray;
FireRain;
SphereProc;
until(False);
end.

Theres atm working version.

E: Fixed it up a little.

Littma

2010-01-26 13:02:12

From: Frement
program zOMGbotBETA;

var i, x, y, teflon, bitmap : Integer;
fire, bandage, divinity : Integer;
sphere : Integer;

procedure LoadBitmaps;
begin
fire := BitmapFromString(16, 12, 'beNpNkV1I0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gQwW726IXbbup2WPteWBtx6cOrA' +
'oQHbOPQEzXQzF3kB02wmfj+sU3rNBD1gEniNreu6FpNbBtPvtk0ys' +
'E2B4RvYccDQUA0a4SCcjb6XMgbywz6ILy0ADktiIBotC52ba1/B6G' +
'sNgVML5Hu4gG5ksrI5gapymqoEyfNoA6Uxw6LLCyCD5Xb4/Rk2ewF' +
'IICUwgFH1VycA56O95KMfBYFTRSztnaDhorjRVxnq5TqgmkD/DGxt' +
'wMtU1WYouKlywLP8lVykKKRpH9KnS8LJwkhFbkRfflT3o2gp51C/p' +
'Rx4Z1TcRCU/ecYn/T4PycsQURagZtOV5WGqyhjyeaxaFKfuTdGtF0' +
'NjmqIuaZ6TMP/f+1JB13AYU4/RWE3IZAWTqA2dbAtXSOLk1tue5pN' +
'yTjz5IsmO80/5z+cL0QQ3wsBlaBrC9YLgmY6oeXHkhDLdSuVDU8qo' +
'MNn49ODsP7+3z9RWhmiqApXCULItRCfdv/jlmFmSpP5ZCdjx/qoEJ' +
'TuW2Ps3i5/11wujZ/hRJC9c2RW/KDlg6D1qrYsbE19cWMaAd34cS9' +
'NyEnX+fb9/Ga1oODJVfRhvOWt8e86qfgDGeljqAL0I7p3+mJM09OQ' +
'E4ZP+80Vx3UuUAi6A/lbobIWREci5a86+qVPKQITBrfTB3D8vGdKo' +
'');
end;

procedure FireRain;
begin
repeat
Wait(2 * 250+random(50));
Writeln('Casting Fire Rain.');
FindBitmapToleranceIn(bitmap, x, y, 0, 0, 436, 539, 1);
MoveMouseSmooth(x, y)
HoldMouse(x, y, True);
Wait(2 * 500+random(50));
ReleaseMouse(x, y, True);
Wait(6 * 1500+random(50));
Writeln('Healing with Bandage.');
FindBitmapToleranceIn(bitmap, x, y, 0, 0, 491, 540, 1);
MoveMouseSmooth(x, y)
Wait(2 * 150+random(50));
ClickMouse(x, y, True);
Wait(2 * 2000+random(50));
Inc(i);
until(i = 10);
end;

procedure BandageProc;
begin
repeat
Wait(2 * 500+random(50));
Writeln('Healing with Bandage.');
FindBitmapToleranceIn(bitmap, x, y, 0, 0, 491, 540, 1);
MoveMouseSmooth(x, y)
Wait(2 * 150+random(50));
ClickMouse(x, y, True);
Wait(2 * 2000+random(50));
Inc(i);
until(i = 1);
end;

procedure DivinityProc;
begin
Wait(2 * 500+random(50));
Writeln('Casting Divinity.');
FindBitmapToleranceIn(bitmap, x, y, 0, 0, 577, 540, 1);
MoveMouseSmooth(x,y)
HoldMouse(x, y, True);
Wait(2 * 1000+random(50));
ReleaseMouse(x, y, True);
Wait(2 * 2500+random(50));
end;

procedure TeflonSpray;
begin
Wait(2 * 250+random(50));
Writeln('Casting Teflon Spray.');
FindBitmapToleranceIn(bitmap, x, y, 0, 0, 604, 540, 1);
MoveMouseSmooth(x,y)
HoldMouse(x, y, True);
Wait(2 * 1000+random(50));
ReleaseMouse(x, y, True);
Wait(2 * 1000+random(50));
end;

procedure SphereProc;
begin
Wait(2 * 250+random(50));
Writeln('Casting Sphere');
FindBitmapToleranceIn(bitmap, x, y, 0, 0, 630, 537, 1);
MoveMouseSmooth(x, y)
HoldMouse(x, y, True);
Wait(2 * 1000+random(50))
ReleaseMouse(x, y, True);
Wait(2 * 1000+random(50));
end;

begin
LoadBitmaps;
repeat
FireRain;
DivinityProc;
FireRain;
TeflonSpray;
FireRain;
SphereProc;
until(False);
end.

Theres atm working version.

E: Fixed it up a little.


Testing now, will edit my post when done. I see the layout and scripting style. Cleaner, and much more efficient. I'll get back to you on the progress.
]

Gu3st...

2010-01-26 13:02:43

From: Frement
Still the script has multiple flaws.
No, it had one more flaw, and that was the bitmap that was named wrong. All the other "flaws" were procedures that you renamed. I am sure they would've worked fine without "Proc" after the name.

EDIT: You updated the post, it looks much cleaner and easier to read now :)

Frement

2010-01-26 13:04:08

From: Zyt3x
No, it had one more flaw, and that was the bitmap that was named wrong. All the other "flaws" were procedures that you renamed. I am sure they would've worked fine without "Proc" after the name


Well the bitmaps had the same names as the procedure, so i think they wouldnt have worked with the same name, or the bitmap names should have been changed.

Gu3st...

2010-01-26 13:08:04

Hmm I see one more flaw..
program zOMGbotBETA;

var i, x, y, teflon : Integer;
fire, bandage, divinity : Integer;
sphere : Integer;

procedure LoadBitmaps;
begin
fire := BitmapFromString(16, 12, 'beNpNkV1I0wEUxX9t2txg/+na' +
'FN3a5iCRSW5gpYwKyxIibA/2VERhIqyICIqKQUREhVpuWcqcE/yoI' +
'VNIRbJI+6AJg0W++JQPrZIK+vAhqAi5/bWIDufhwj3n3nO5Jt7scY' +
'7CfCUyWS9h23s/2TKS8LmxSC6YZLymt4RuE1MbkbbKb8dLonp6DCw' +
'dtchgpYQMPw4UD+uZr0cueT8eLJgqZ9DEqAu5aZfrjsQGTkCfXfVW' +
'ydmCbIChIl7sRm54pN2XKKRHy4AZCTklsSW9nyu5nDKibpTTjuVm1' +
'7iLV4eQuFvaHYkKOnLpK2QxiCQ3L53zhNfRmsNJC8vny+SYZdzCUx' +
'8y6JC4OXuELoWhUl63FMj9WomUx+xcy6HTzPfIVrnonXEz40Au22T' +
'AKh3Ks1IeFfOyEZneIYmGEQ+da+kykA4Qqss/41MCOcz51djrpcf5' +
'qXlNSs+Can++Tx5uv+clrOEqxHSkapFMVCWrkFi1tNVOW3lr4qt6V' +
'H/DEx9xPd2QyDPeYqXIRKsk0/LHIrFNi3uts2bmNSwofNjJ3DYkuO' +
'uxu3jUaOyHB1r+Tl7V/wxpfzU5p82klLwxHWMVSK9/qck3YdfF4a7' +
'6Vqf+f72KTA1TFpIGxtQ84bp3QVtM4Tao7VlXftq6kucfVX1Ez7CJ' +
'SfuK+Mvh6gi0woiiuZPLEMz8Bp9d0Q4=');
bandage := BitmapFromString(14, 10, 'beNo9zM0vw3AAxnF/iT/Bh' +
'ZC4uRNOSCQOIi7inVAmi4uXhIWglBjd1lnbdVsXHSPzErLMWrq2W7' +
'PZZjhIvMTYRruR/TSW+OY5fvJMNLrhAe+2jtmCXPDQM2fNirgiWCQ' +
'cAiKqBtau0MF7Zto51fTg0nvgPudSt2d9+In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String(15, 15, 'beNo90MlrE2EYBnD/Ai8qQV' +
'DxItqoFY1ibRNMDdUszb42k8xMFpNMZkkySSaZyWSPTWvSlJqLKdX' +
'QQ0V6EU8ePCgILhBPnmoPIh6KUItHBWF820E/Xj7m8Hsfnm+2v3/7' +
'LW28fE/We83BExgs3whk6yqj74zaqBhXHzt/46Rq+vgljeLilEI5w' +
'XVXSyuPiWoX55rp+T7TWkHzzTsodeqaDjDIE1e0R8auA1Zbg0R1KX' +
'XvQVRoo7k6xMLtz1SDuYYtnr+gsx9VToBUai2uZBFhxAjfBhkTF0E' +
'GszXACFuDCfNtc5SdDaf1KGUKpcyRDMbW4uVOhJ9PVDqhQgs+AEMN' +
'NyXAQHl/ujKXKoN0EoVSby1R6YKEcOgcYKuuZAFqAPMyIngwEOulS' +
'zMIcXZSf1mtu3pzRq7hJov+dNlBFJzJIqzA7aEEWWo90VCuIY0Ghw' +
'4O1PDSAqzYExxISHaRvAGjjTjjSHA410qUFqVRTPbQZC4lWu+ycDc' +
'ebmD5JlSFnwA1fKRAVpZuuSPAZCwuP4oLCz6S760/6ww3bZGMPcrC' +
'WMNpA0KYgiTMfwxne+/P609ff0qSNUQbkLgZI2/7YhprcBaldO6I2' +
'hIYDVTyAK7113cl6fPuL6bWdcVYWAH2bmtn2hk6fHr83KT+H95Pfr' +
'u1sydJ+XZ/48UbotQ2BQkIhA4fv/wYmzJEudbBA2OD2D5m6st4tm7' +
'BKTQt1vtDLFNG6JInwd1f21xYfap14HKyjDU21IwzOndI60D9VNEd' +
'z5oxOsCIw+ev+M7gw1/lVhrk');
sphere := BitmapFromString(16, 16, 'beNo9z11MUnEYBvC/iCio82' +
'OrprZZdtEsXVpzrbxotrWumm1d19pabn3MavMjP9eMTEOxY4mBaJr' +
'SVCxCW9PM1EQpPAgeOYiCH8BARVHwIJYhbySrZ+/l73m2N3WsNmiu' +
'jmXEGHO5wZ925UB2Ocz1zq3X8EsKnnGwz4FpzmVf3LFqKRvpMak8f' +
'IatMWKjAhnY+8Y9A0AIl6zYuqcZNt8AjMKGlnKY1xyGZWrWvqZaXV' +
'FSohC7kG6pQvPFLNmOFKztXgtGuYVerwRcfbsuYosyONbIlQ3SQZH' +
'bTsLbgXRNaLKJZS2gDYmu6GEQlgQwW726IXbbup2WPteWBtx6cOrA' +
'oQHbOPQEzXQzF3kB02wmfj+sU3rNBD1gEniNreu6FpNbBtPvtk0ys' +
'E2B4RvYccDQUA0a4SCcjb6XMgbywz6ILy0ADktiIBotC52ba1/B6G' +
'sNgVML5Hu4gG5ksrI5gapymqoEyfNoA6Uxw6LLCyCD5Xb4/Rk2ewF' +
'IICUwgFH1VycA56O95KMfBYFTRSztnaDhorjRVxnq5TqgmkD/DGxt' +
'wMtU1WYouKlywLP8lVykKKRpH9KnS8LJwkhFbkRfflT3o2gp51C/p' +
'Rx4Z1TcRCU/ecYn/T4PycsQURagZtOV5WGqyhjyeaxaFKfuTdGtF0' +
'NjmqIuaZ6TMP/f+1JB13AYU4/RWE3IZAWTqA2dbAtXSOLk1tue5pN' +
'yTjz5IsmO80/5z+cL0QQ3wsBlaBrC9YLgmY6oeXHkhDLdSuVDU8qo' +
'MNn49ODsP7+3z9RWhmiqApXCULItRCfdv/jlmFmSpP5ZCdjx/qoEJ' +
'TuW2Ps3i5/11wujZ/hRJC9c2RW/KDlg6D1qrYsbE19cWMaAd34cS9' +
'NyEnX+fb9/Ga1oODJVfRhvOWt8e86qfgDGeljqAL0I7p3+mJM09OQ' +
'E4ZP+80Vx3UuUAi6A/lbobIWREci5a86+qVPKQITBrfTB3D8vGdKo' +
'');
end;

procedure FireRain;
begin
repeat
Wait(2 * 250+random(50));
Writeln('Casting Fire Rain.');
FindBitmapToleranceIn(fire, x, y, 0, 0, 436, 539, 1);
MoveMouseSmooth(x, y)
HoldMouse(x, y, True);
Wait(2 * 500+random(50));
ReleaseMouse(x, y, True);
Wait(6 * 1500+random(50));
Writeln('Healing with Bandage.');
FindBitmapToleranceIn(fire, x, y, 0, 0, 491, 540, 1);
MoveMouseSmooth(x, y)
Wait(2 * 150+random(50));
ClickMouse(x, y, True);
Wait(2 * 2000+random(50));
Inc(i);
until(i = 10);
end;

procedure BandageProc;
begin
repeat
Wait(2 * 500+random(50));
Writeln('Healing with Bandage.');
FindBitmapToleranceIn(bandage, x, y, 0, 0, 491, 540, 1);
MoveMouseSmooth(x, y)
Wait(2 * 150+random(50));
ClickMouse(x, y, True);
Wait(2 * 2000+random(50));
Inc(i);
until(i = 1);
end;

procedure DivinityProc;
begin
Wait(2 * 500+random(50));
Writeln('Casting Divinity.');
FindBitmapToleranceIn(divinity, x, y, 0, 0, 577, 540, 1);
MoveMouseSmooth(x,y)
HoldMouse(x, y, True);
Wait(2 * 1000+random(50));
ReleaseMouse(x, y, True);
Wait(2 * 2500+random(50));
end;

procedure TeflonSpray;
begin
Wait(2 * 250+random(50));
Writeln('Casting Teflon Spray.');
FindBitmapToleranceIn(teflon, x, y, 0, 0, 604, 540, 1);
MoveMouseSmooth(x,y)
HoldMouse(x, y, True);
Wait(2 * 1000+random(50));
ReleaseMouse(x, y, True);
Wait(2 * 1000+random(50));
end;

procedure SphereProc;
begin
Wait(2 * 250+random(50));
Writeln('Casting Sphere');
FindBitmapToleranceIn(sphere, x, y, 0, 0, 630, 537, 1);
MoveMouseSmooth(x, y)
HoldMouse(x, y, True);
Wait(2 * 1000+random(50))
ReleaseMouse(x, y, True);
Wait(2 * 1000+random(50));
end;

begin
LoadBitmaps;
repeat
FireRain;
DivinityProc;
FireRain;
TeflonSpray;
FireRain;
SphereProc;
until(False);
end.

You should also free your bitmaps with
FreeBitmap(bitmap_name);
I. E FreeBitmap(sphere);

Littma

2010-01-26 13:09:03

Turns out it is NOT finding the bitmap when it is clearly on the screen.
(I target the window as a note)
Do you see anything that could cause this problem where it does NOT find the bitmap?
Thanks in advance.

Example: the cords of the bitmap are 434, 540 which it goes to 0, 0 of the targeted window.

The reason I'm choosing to use bitmaps are because when I change things around, i'd rather not change the cords constantly so trying to make it find a bitmap instead of following cords.

EDIT:
So my question is how could I make it to find the bitmap without cords?

From: Zyt3x
You should also free your bitmaps with
FreeBitmap(bitmap_name);
I. E FreeBitmap(sphere);


Indeed, though where would I place the freebitmap string? line 1 of the procedure after begin?

Frement

2010-01-26 13:14:33

Could you like post a link to the game?

Gu3st...

2010-01-26 13:20:56

Place all the FreeBitmaps in a procedure called "ScriptTerminate".
ScriptTerminate is called when the script is stopped / terminated

Littma

2010-01-26 13:27:19

From: Frement
Could you like post a link to the game?

http://www.gaiaonline.com/zomglanding/

Though the bitmaps I am choosing come from various rings throughout the game which can be given by game play.

The point of the script is to use a ring to attack (multi-target as the monsters are aggressive) heal, and re-buff.

From: Zyt3x
Place all the FreeBitmaps in a procedure called "ScriptTerminate".
ScriptTerminate is called when the script is stopped / terminated


I appreciate the help, I'll take note on that.
I don't know what I'd do without you both :3

Though as I've been wondering, the command I'm using to find the bitmaps then click them are not working. Most likely because it's not the right command for the job. Is there another command to find the bitmap, then do an action?
(I've searched for a bitmap tutorial on this, no luck :( )

Gu3st...

2010-01-26 13:32:49

From: Littma
http://www.gaiaonline.com/zomglanding/

Though the bitmaps I am choosing come from various rings throughout the game which can be given by game play.

The point of the script is to use a ring to attack (multi-target as the monsters are aggressive) heal, and re-buff.



I appreciate the help, I'll take note on that.
I don't know what I'd do without you both :3

Though as I've been wondering, the command I'm using to find the bitmaps then click them are not working. Most likely because it's not the right command for the job. Is there another command to find the bitmap, then do an action?
(I've searched for a bitmap tutorial on this, no luck :( )
FindBitmap should work just fine, try re-doing your bitmap and test again :)
EDIT: Have you tried MoveMouse(x, y); instead of MoveMouseSmooth(x, y);?
I think that might solve the problem

Frement

2010-01-26 13:37:46

You should try DTM's too. Thought bitmaps should be working fine.

Littma

2010-01-26 13:43:35

From: Zyt3x
FindBitmap should work just fine, try re-doing your bitmap and test again :)
EDIT: Have you tried MoveMouse(x, y); instead of MoveMouseSmooth(x, y);?
I think that might solve the problem


Yes - I used to use cords for MoveMouse/MoveMouseSmooth both worked fine. Just decided to use bitmaps so I wouldn't have to change the location of the rings when I move them and or upgrade.

Currently testing Find Bitmap though having an issue with it.
       if(FindBitmap (fire,x,y)) then
movemouse(x,y)
Which returns in the error
[Runtime Error] : Exception: Access violation at address 006BDDC8 in module 'scar.exe'. Read of address 00000000 in line 24 in script 
Line 24 is the string of 'if(FindBitmap (fire,x,y)) then' as I created a new file to test bitmaps in.

From: Frement
You should try DTM's too. Thought bitmaps should be working fine.

I've thought about it, though having trouble finding a tutorial on Bitmaps/DTM's. Like I said, I tried the FindBitmap string and no luck, getting a SCAR error.
[Runtime Error] : Exception: Access violation at address 006BDDC8 in module 'scar.exe'.

Gu3st...

2010-01-26 13:45:48

From: Littma
Yes - I used to use cords for MoveMouse/MoveMouseSmooth both worked fine. Just decided to use bitmaps so I wouldn't have to change the location of the rings when I move them and or upgrade.

Currently testing Find Bitmap though having an issue with it.
       if(FindBitmap (fire,x,y)) then
movemouse(x,y)
Which returns in the error
[Runtime Error] : Exception: Access violation at address 006BDDC8 in module 'scar.exe'. Read of address 00000000 in line 24 in script 
Line 24 is the string of 'if(FindBitmap (fire,x,y)) then' as I created a new file to test bitmaps in.


I've thought about it, though having trouble finding a tutorial on Bitmaps/DTM's. Like I said, I tried the FindBitmap string and no luck, getting a SCAR error.
[Runtime Error] : Exception: Access violation at address 006BDDC8 in module 'scar.exe'.
Did you load/declare the bitmap before using it? Have you tried saving the script and restarting scar?

Littma

2010-01-26 13:51:24

Alright - I think I found out what the problem was.
I forgot to add the variable for the bitmap :duh:
Thanks a billion guys, I'll report back with progress.

Littma

2010-01-26 14:23:52

Alright, I believe this is my last problem.


procedure FireRain;
var i, fire, bandage : Integer;
begin
repeat
Wait(2 * 250+random(50));
Writeln('Casting Fire Rain.');
if FindBitmap(fire, x, y) then
MoveMouseSmooth(x, y);
HoldMouse(x, y, True);
Wait(2 * 500+random(50));
ReleaseMouse(x, y, True);
Wait(6 * 1500+random(50));
Writeln('Healing with Bandage.');
if FindBitmap(bandage, x, y) then;
MoveMouseSmooth(x, y);
Wait(2 * 150+random(50));
ClickMouse(x, y, True);
Wait(2 * 2000+random(50));
Inc(i);
until(i = 10);
end;
I can see what's wrong here where it will not do the bandage command after the fire rain command.
I tried fixing the problem by using this.


procedure FireRain;
var i, fire, bandage : Integer;
begin
repeat
Wait(2 * 250+random(50));
Writeln('Casting Fire Rain.');
if FindBitmap(fire, x, y) then
MoveMouseSmooth(x, y);
HoldMouse(x, y, True);
Wait(2 * 500+random(50));
ReleaseMouse(x, y, True);
Wait(6 * 1500+random(50));
end;
begin
Writeln('Healing with Bandage.');
if FindBitmap(bandage, x, y) then;
MoveMouseSmooth(x, y);
Wait(2 * 150+random(50));
ClickMouse(x, y, True);
Wait(2 * 2000+random(50));
Inc(i);
until(i = 10);
end;
end;
Though returns with this error

Line 103: [Error] (103:1): Identifier expected in script
Which is the 'end;' after 'Wait(6 * 1500+random(50));'
Any ideas? ^^

Dynamite

2010-01-26 14:45:50

is this for WoW?

Frement

2010-01-26 14:49:17

From: The Man
is this for WoW?


If you would have read the thread you would know that its not ;)

Also, littma, no double posting.

Littma

2010-01-26 14:50:14

From: The Man
is this for WoW?


Something similar, though for Gaiaonline.
Everyone stopped posting when I thought it was fixed, now came up with this one error :duh: (stated on first post, edited)

Dynamite

2010-01-26 14:50:36

I have just read again and still do not see where it says it isnt for Wow? :S
BTW Littma, you need an Until because you have a repeat

Littma

2010-01-26 14:52:50

From: The Man
I have just read again and still do not see where it says it isnt for Wow? :S
BTW Littma, you need an Until because you have a repeat


I do see how that can come in handy, though where would I place such a thing? After the breaking end between fire rain/bandage?
Like

procedure FireRain;
var i, fire, bandage : Integer;
begin
repeat
Wait(2 * 250+random(50));
Writeln('Casting Fire Rain.');
if FindBitmap(fire, x, y) then
MoveMouseSmooth(x, y);
HoldMouse(x, y, True);
Wait(2 * 500+random(50));
ReleaseMouse(x, y, True);
Wait(6 * 1500+random(50));
Inc(i);
until(i = 1);
end;
begin
repeat
Writeln('Healing with Bandage.');
if FindBitmap(bandage, x, y) then;
MoveMouseSmooth(x, y);
Wait(2 * 150+random(50));
ClickMouse(x, y, True);
Wait(2 * 2000+random(50));
Inc(i);
until(i = 1);
end;
end;

Though even with this done, I need it to be one big loop which I have not learned how to do loops yet o.o