PDA

View Full Version : [Minigame] Adieux's Pest Control



Adieux
08-05-2015, 02:18 AM
Adieux's Pest Control Script


What it does:
1. Plays pest control for you

How to set up
1. Go here (https://villavu.com/forum/showthread.php?t=112599), read the post, and download ogLib

2. Download the zip folder below

3. Extract into your c:\simba\scripts folder
It should look like this (the file path is important)
http://i60.tinypic.com/2n0v59g.png

4. Hit run on the auto updater and it will download the newest version of the script into the Adieuxs Pestcontrol folder

5. Make sure your graphic settings are like so
Important: I've tried higher resolutions and it was not clicking correctly.
Must be on 800x600 (now fixed, just be aware you might lag more at higher res)
http://i57.tinypic.com/20f3o7.png

6. 3D game world must go across the client, edit like so
http://i.giphy.com/l41lGAOTcPp9eTQ5O.gif

7. UI layout doesn't have to be like this, but this is what I recommend. (leave map big, for walking purposes)
http://i59.tinypic.com/214p02a.jpg

8. I highly recommend using magic/range and having auto retaliate on for faster damage

9. You can start the script in 3 places. Inside the boat, outside the boat near the gangplank, or inside pestcontrol

If starting outside, place character here
http://i59.tinypic.com/2zf4gth.jpg

Proggies:
http://i57.tinypic.com/122c9xl.png
by: Grimxxdeath223;
http://puu.sh/ju5Zj/82b1fec063.jpg
by: Grimxxdeath223;
http://puu.sh/jtruU/8199fa90cc.jpg
by: Grimxxdeath223;
http://puu.sh/jtqlt/5e98fc1a40.jpg
by BuffaloBill;
http://puu.sh/jtbTg/a9bc5f79e8.jpg
https://puu.sh/js9rE/717566d111.jpg
http://puu.sh/jpO14/5974eaa19e.jpg



1. Will not find the correct position when starting the script outside for the first time
Fix: Start the script inside the boat or inside pest control
2. Wind up abilities such as Detonate do not work
Fix: None right now, dont use those abilities :redface:



Upcoming features:
1. Support for threshold abilities
2. Support for portals as soon as I gather all of the ID's
3. Support for more pests when I get the time missing pests currently: (torcher, spinner)
4. Goes and buys things with points, if people want that


Mentions:
Thanks to everyone who helped me test/gave feedback/suggestions.
adc
Grimxxdeath223
Clarity
Obscurity
Clutch
Fady
Ross


Changes:

2.3: Threshold ability and ultimate Support, fixed access
violation errors, fixed issue where it would get stuck on boot screen
some times

2.2: Completely rewrote the click procedure, attack procedure
Now supports portal priority I.E will attack portal if available before
anything else

2.0: Added fix for boots (thanks obscurity and clutch)
Added in all models for pests/portals (thanks obscurity)
A ton of other small fixes
Sped up the wait timers to make getting into boat faster

1.4 Added a terminate function that will free BMP file, as well as added override for
minimap.clickresetcamera as it would fail to click the compass a lot

1.3 Fixed stupid mistake where I forgot to assign boolean value to result causing Access Violation error

1.2 Removed boots fix as mouse click on the boxes was not working, will only close out of the screen (still needs testing)

1.1: Fixed auto updater and added support for mini game boots (thanks to Clutch)

1.0: Initial release



If you use please post feedback/proggies or comments

srlMW
08-05-2015, 02:21 AM
Congratulations on your official release!
What's the longest time you've run it for?

e: my post didn't register or something... so here it is again.

Adieux
08-05-2015, 02:22 AM
Congratulations on your official release!
What's the longest time you've run it for?

e: my post didn't register or something... so here it is again.

Thanks a lot!

I've ran it for 2 hours, without adding anything new to it but didnt get a progress screen because I didnt have one haha.

I've gotten over 1,000 points with this tho, in the time it took me to make/test it.

Your post registered I just deleted that thread because I posted it in the wrong section lol.

Clutch
08-05-2015, 03:34 AM
Thanks a lot!

I've ran it for 2 hours, without adding anything new to it but didnt get a progress screen because I didnt have one haha.

I've gotten over 1,000 points with this tho, in the time it took me to make/test it.

Your post registered I just deleted that thread because I posted it in the wrong section lol.

So one annoying thing I came across (yes I said I got my last 400 points but I have nothing else I want to run right now) is every 5-20 minutes I'm getting a screen for minigame boots. Gonna get textures to click through it and will give it to ya so you can add to the script.

Seriously 9 pairs of boots in the past 4 hours. >.> Maybe there's a way to turn this off though?

Adieux
08-05-2015, 03:42 AM
So one annoying thing I came across (yes I said I got my last 400 points but I have nothing else I want to run right now) is every 5-20 minutes I'm getting a screen for minigame boots. Gonna get textures to click through it and will give it to ya so you can add to the script.

Seriously 9 pairs of boots in the past 4 hours. >.> Maybe there's a way to turn this off though?

Experienced my first boots right before release if you could send me those textures that would be great. So weird I got my first boots after maybe 20 hours of pest control lmao and forgot to get the ID

Clutch
08-05-2015, 03:59 AM
Experienced my first boots right before release if you could send me those textures that would be great. So weird I got my first boots after maybe 20 hours of pest control lmao and forgot to get the ID

Edit: also heres the release thread, more updated with add suggestions from everyone on here. Still need to do some things but its coming
https://villavu.com/forum/showthread.php?t=114186
Where I posted :)

// BM[80, 138, 119, 176] / Trick[142, 136, 181, 181] VG[204, 136, 244, 183] - Coords of the boxes for each boot with the interface at the far top left. As for Texture ID's this is one of those interfaces that doesn't have ID's for the items unfortunately :/. As for detecting it - (not sure if this is a unique texture or not but there was a texture - 2244000 but this is for the entire screen and the box within this screen around all three boots. I had to filter it and a couple others and nothing showed up after that.

Adieux
08-05-2015, 04:01 AM
Where I posted :)

// BM[80, 138, 119, 176] / Trick[142, 136, 181, 181] VG[204, 136, 244, 183] - Coords of the boxes for each boot with the interface at the far top left. As for Texture ID's this is one of those interfaces that doesn't have ID's for the items unfortunately :/. As for detecting it - (not sure if this is a unique texture or not but there was a texture - 2244000 but this is for the entire screen and the box within this screen around all three boots. I had to filter it and a couple others and nothing showed up after that.

For some reason I thought it was posted on the other thread hahah.
Thank you so much for the boxes and the ID's will add this soon, probably tonight!

Clutch
08-05-2015, 04:02 AM
For some reason I thought it was posted on the other thread hahah.
Thank you so much for the boxes and the ID's will add this soon, probably tonight!
Edit: Found a fix - at least for me. This will detect the window (yes it is a shop window according to OGL) and basically hit escape to close out and then choose option 1 agreeing that we want to close. Obviously you can do what you want with this as the big part is knowing its a shop window so you can just have it click to one of the TBox's above.
Adieux;
if shop.hasShop then
begin
typeByte(VK_ESCAPE);
wait(normalRandom(250,750);
sendKeys('1', 60 + random(60), 60 + random(60));
end;

Added the above at line 355 - testing to see if this does the trick or if it needs modified.

Ross
08-05-2015, 04:22 AM
[COLOR="#00FFFF"]Ross

Hey, what did I do?! :D

Adieux
08-05-2015, 04:22 AM
Edit: Found a fix - at least for me. This will detect the window (yes it is a shop window according to OGL) and basically hit escape to close out and then choose option 1 agreeing that we want to close. Obviously you can do what you want with this as the big part is knowing its a shop window so you can just have it click to one of the TBox's above.
Adieux;
if shop.hasShop then
begin
typeByte(VK_ESCAPE);
wait(normalRandom(250,750);
sendKeys('1', 60 + random(60), 60 + random(60));
end;

Added the above at line 355 - testing to see if this does the trick or if it needs modified.

Ah ok awesome yeah the hardest part would be figuring out the window is open and you seem to have done that,
Will add this in as soon as I finish this dung (yeah im playing legit im nuts haha)
Thanks again man


Hey, what did I do?! :D

Your walking procedure as well the up text fix you gave in that other thread!

Adieux
08-05-2015, 04:24 AM
@Clutch added the fix in, will be testing all night (hopefully get the screen).
Also fixed an auto updater issue so you have to download the newest files up top to get the fix

J_R
08-05-2015, 05:37 AM
Very nice, congrats on the release! Hopefully it blows mine out of the water :P

Grimxxdeath223
08-05-2015, 09:03 AM
Congrats on your official release. Glad I could help out with some testing. Going to look at this more once I am done with what I am currently doing in game.

Adieux
08-05-2015, 03:31 PM
Very nice, congrats on the release! Hopefully it blows mine out of the water :P
Thank you haha



Congrats on your official release. Glad I could help out with some testing. Going to look at this more once I am done with what I am currently doing in game.
Thanks for the help again man

Clutch
08-05-2015, 06:08 PM
So the boots gets detected but of course - the mousebox coords are still off. I had this same problem with my mills script. I don't know if it's an issue with my computer resolution not showing coords correctly or if it's just broken in general.

Adieux
08-05-2015, 06:41 PM
So the boots gets detected but of course - the mousebox coords are still off. I had this same problem with my mills script. I don't know if it's an issue with my computer resolution not showing coords correctly or if it's just broken in general.

I've had issues with Tbox clicking as well, what resolution are you playing on?

For now Ill just add what you suggested above so that it just closes out the screen and doesn't select anything.

Clutch
08-05-2015, 07:24 PM
I've had issues with Tbox clicking as well, what resolution are you playing on?

For now Ill just add what you suggested above so that it just closes out the screen and doesn't select anything.

1920 x 1080 - I haven't been able to verify if selecting escape and then pressing 1 fixes it - Was getting back to back boots then put out a fix and now getting the dialogue is next to impossible. Figures..

Adieux
08-05-2015, 07:34 PM
1920 x 1080 - I haven't been able to verify if selecting escape and then pressing 1 fixes it - Was getting back to back boots then put out a fix and now getting the dialogue is next to impossible. Figures..

Ahhh, I always just leave smart at the default 800x600. I tried upping it to 1024x768 and was failing to detect models properly, even enabled the debugger to show models and
the models were showing in a random area no where near the true location.

And lol seriously, have yet to get the screen for boots.

Clutch
08-06-2015, 01:45 AM
Ahhh, I always just leave smart at the default 800x600. I tried upping it to 1024x768 and was failing to detect models properly, even enabled the debugger to show models and
the models were showing in a random area no where near the true location.

And lol seriously, have yet to get the screen for boots.

I was referencing my computer resolution. As it's different from my other machine which doesn't seem to have some of the bugs/glitches that this one does.

Obscurity
08-06-2015, 02:57 AM
2. Support for portals as soon as I gather all of the ID's
3. Support for more pests when I get the time missing pests currently: (torcher, spinner)



[1731643360,2547232634,2782989724,2899052740,348978 5670,3915285997,547053328,617765920]
The IDs of anything attackable in PC, including portals.

This was my attack procedure, before I update ogLib a bit and started really using the The Scan and React Method (https://villavu.com/forum/showthread.php?t=113549):
procedure pAttack;
var
funcPointArray:tPointArray;
begin
writeLN('[procedure] pAttack');
if length(funcPointArray:=ogl.getClientMidPoint().clo sest(ogl.getModels(tCardinalArray([1731643360,2547232634,2782989724,2899052740,348978 5670,3915285997,547053328,617765920])).getVisible())) then
begin
if random(5)=0 then
mouse.rightClickOption(funcPointArray[0].adjustPosition(0,-25).randomizePointEllipse(20),['Attack Brawler','Attack Defiler','Attack Portal','Attack Shifter','Attack Spinner','Attack Splatter','Attack Torcher'])
else
mouse.click(funcPointArray[0].adjustPosition(0,-25).randomizePointEllipse(20));
canAttack.setTime(canWalk.setTime(random(500,1500) ));
end
else
canRotate.setTime(0);
end;

Now, for the resolutions that aren't 800x600. If you're using a resolution that's not 800x600, you might, not always, have to use glxViewPort().

So to do this...
//~ Etc...

var
tempX,tempY:int32; {Don't assign any values}

begin
autoUpdateMe();
ogl.setup(1024,640);
glxViewPort(tempX,tempY,tempX,tempY); {This will fix OGL positions}
ogl.setDebugMode(0);
scriptPaintBMP := loadBitmap( AppPath + 'scripts\Adieuxs Pestcontrol\AdieuxsPestcontrolPaint.jpg');
whereAreWe();

//~ Etc...

I made note of your override for clicking the minimap compass. It'll be fixed in the next update.

Keep in mind, you can adjust the vertical height of the camera with mainScreen, just to make it a bit more realistic. mainScreen.setDegrees(horizontal,vertical). This will change both at the same time. Or, you can set them individually.

A good idea, is get the camera prepared when they're killing the last flag - typically, if I recall, facing randomly between north-west and east was very safe (random(270,405) degrees). To prevent accidentally walking after the game ends, you can also prevent from calling any walk/attack procedure when the last portal is open.

The gangplank model IDs can change. All of them are:
[1781393848,2892440677,3763942768,4136683396,416894 9912]

Since I don't want to completely spoil the one in SRL Members, I'll make this my last comment (since I saw your comment about working on a fix for boots):
procedure pSelect;
var
funcPointArray:tPointArray;
begin
writeLN('[procedure] pSelect');
if length(funcPointArray:=mouse.getPoint().closest(og l.getModels(tCardinalArray([940746976,432722987,3341867181])))) then
begin
if random(5)=0 then
mouse.rightClickOption(funcPointArray[0].randomizePointEllipse(30),'Select')
else
mouse.click(funcPointArray[0].randomizePointEllipse(30));
end;
canCross.setTime(random(1500,2500));
end;
Those 3 IDs are the boots. It'll simply select the one closest to the mouse. If you wanted it to select a random one:
procedure pSelect;
var
funcModelrray:glModelArray;
begin
writeLN('[procedure] pSelect');
if length(funcModelArray:=ogl.getModels(tCardinalArra y([940746976,432722987,3341867181]))) then
begin
if random(5)=0 then
mouse.rightClickOption(funcModelArray[random(3)].randomizePointEllipse(30),'Select')
else
mouse.click(funcModelArray[random(3)].randomizePointEllipse(30));
end;
canCross.setTime(random(1500,2500));
end;



+Rep. Great work!

Adieux
08-06-2015, 05:11 AM
[1731643360,2547232634,2782989724,2899052740,348978 5670,3915285997,547053328,617765920]
The IDs of anything attackable in PC, including portals.

This was my attack procedure, before I update ogLib a bit and started really using the The Scan and React Method (https://villavu.com/forum/showthread.php?t=113549):
procedure pAttack;
var
funcPointArray:tPointArray;
begin
writeLN('[procedure] pAttack');
if length(funcPointArray:=ogl.getClientMidPoint().clo sest(ogl.getModels(tCardinalArray([1731643360,2547232634,2782989724,2899052740,348978 5670,3915285997,547053328,617765920])).getVisible())) then
begin
if random(5)=0 then
mouse.rightClickOption(funcPointArray[0].adjustPosition(0,-25).randomizePointEllipse(20),['Attack Brawler','Attack Defiler','Attack Portal','Attack Shifter','Attack Spinner','Attack Splatter','Attack Torcher'])
else
mouse.click(funcPointArray[0].adjustPosition(0,-25).randomizePointEllipse(20));
canAttack.setTime(canWalk.setTime(random(500,1500) ));
end
else
canRotate.setTime(0);
end;

Now, for the resolutions that aren't 800x600. If you're using a resolution that's not 800x600, you might, not always, have to use glxViewPort().

So to do this...
//~ Etc...

var
tempX,tempY:int32; {Don't assign any values}

begin
autoUpdateMe();
ogl.setup(1024,640);
glxViewPort(tempX,tempY,tempX,tempY); {This will fix OGL positions}
ogl.setDebugMode(0);
scriptPaintBMP := loadBitmap( AppPath + 'scripts\Adieuxs Pestcontrol\AdieuxsPestcontrolPaint.jpg');
whereAreWe();

//~ Etc...

I made note of your override for clicking the minimap compass. It'll be fixed in the next update.

Keep in mind, you can adjust the vertical height of the camera with mainScreen, just to make it a bit more realistic. mainScreen.setDegrees(horizontal,vertical). This will change both at the same time. Or, you can set them individually.

A good idea, is get the camera prepared when they're killing the last flag - typically, if I recall, facing randomly between north-west and east was very safe (random(270,405) degrees). To prevent accidentally walking after the game ends, you can also prevent from calling any walk/attack procedure when the last portal is open.

The gangplank model IDs can change. All of them are:
[1781393848,2892440677,3763942768,4136683396,416894 9912]

Since I don't want to completely spoil the one in SRL Members, I'll make this my last comment (since I saw your comment about working on a fix for boots):
procedure pSelect;
var
funcPointArray:tPointArray;
begin
writeLN('[procedure] pSelect');
if length(funcPointArray:=mouse.getPoint().closest(og l.getModels(tCardinalArray([940746976,432722987,3341867181])))) then
begin
if random(5)=0 then
mouse.rightClickOption(funcPointArray[0].randomizePointEllipse(30),'Select')
else
mouse.click(funcPointArray[0].randomizePointEllipse(30));
end;
canCross.setTime(random(1500,2500));
end;
Those 3 IDs are the boots. It'll simply select the one closest to the mouse. If you wanted it to select a random one:
procedure pSelect;
var
funcModelrray:glModelArray;
begin
writeLN('[procedure] pSelect');
if length(funcModelArray:=ogl.getModels(tCardinalArra y([940746976,432722987,3341867181]))) then
begin
if random(5)=0 then
mouse.rightClickOption(funcModelArray[random(3)].randomizePointEllipse(30),'Select')
else
mouse.click(funcModelArray[random(3)].randomizePointEllipse(30));
end;
canCross.setTime(random(1500,2500));
end;



+Rep. Great work!

Oh my god dude this is awesome thank you so much you're too helpful!
I will try to get these all added into the script tomorrow, wow again thanks so much!

wingerfinger
08-06-2015, 06:49 AM
WHOA
i know im late but congrats on release
cant wait to try it out :d
first castle wars then this?!
amazing

Adieux
08-06-2015, 06:58 AM
WHOA
i know im late but congrats on release
cant wait to try it out :d
first castle wars then this?!
amazing

I never released a castle wars script, that was all Obscurity
But thank you, let me know what you think when you try it out!

wingerfinger
08-06-2015, 07:27 AM
I never released a castle wars script, that was all Obscurity
But thank you, let me know what you think when you try it out!

ik ik i meant as in right when we were given a castlewars script we got another minigame script
im just hyped to see these :)

Clutch
08-06-2015, 07:22 PM
[1731643360,2547232634,2782989724,2899052740,348978 5670,3915285997,547053328,617765920]
The IDs of anything attackable in PC, including portals.

This was my attack procedure, before I update ogLib a bit and started really using the The Scan and React Method (https://villavu.com/forum/showthread.php?t=113549):
procedure pAttack;
var
funcPointArray:tPointArray;
begin
writeLN('[procedure] pAttack');
if length(funcPointArray:=ogl.getClientMidPoint().clo sest(ogl.getModels(tCardinalArray([1731643360,2547232634,2782989724,2899052740,348978 5670,3915285997,547053328,617765920])).getVisible())) then
begin
if random(5)=0 then
mouse.rightClickOption(funcPointArray[0].adjustPosition(0,-25).randomizePointEllipse(20),['Attack Brawler','Attack Defiler','Attack Portal','Attack Shifter','Attack Spinner','Attack Splatter','Attack Torcher'])
else
mouse.click(funcPointArray[0].adjustPosition(0,-25).randomizePointEllipse(20));
canAttack.setTime(canWalk.setTime(random(500,1500) ));
end
else
canRotate.setTime(0);
end;

Now, for the resolutions that aren't 800x600. If you're using a resolution that's not 800x600, you might, not always, have to use glxViewPort().

So to do this...
//~ Etc...

var
tempX,tempY:int32; {Don't assign any values}

begin
autoUpdateMe();
ogl.setup(1024,640);
glxViewPort(tempX,tempY,tempX,tempY); {This will fix OGL positions}
ogl.setDebugMode(0);
scriptPaintBMP := loadBitmap( AppPath + 'scripts\Adieuxs Pestcontrol\AdieuxsPestcontrolPaint.jpg');
whereAreWe();

//~ Etc...

I made note of your override for clicking the minimap compass. It'll be fixed in the next update.

Keep in mind, you can adjust the vertical height of the camera with mainScreen, just to make it a bit more realistic. mainScreen.setDegrees(horizontal,vertical). This will change both at the same time. Or, you can set them individually.

A good idea, is get the camera prepared when they're killing the last flag - typically, if I recall, facing randomly between north-west and east was very safe (random(270,405) degrees). To prevent accidentally walking after the game ends, you can also prevent from calling any walk/attack procedure when the last portal is open.

The gangplank model IDs can change. All of them are:
[1781393848,2892440677,3763942768,4136683396,416894 9912]

Since I don't want to completely spoil the one in SRL Members, I'll make this my last comment (since I saw your comment about working on a fix for boots):
procedure pSelect;
var
funcPointArray:tPointArray;
begin
writeLN('[procedure] pSelect');
if length(funcPointArray:=mouse.getPoint().closest(og l.getModels(tCardinalArray([940746976,432722987,3341867181])))) then
begin
if random(5)=0 then
mouse.rightClickOption(funcPointArray[0].randomizePointEllipse(30),'Select')
else
mouse.click(funcPointArray[0].randomizePointEllipse(30));
end;
canCross.setTime(random(1500,2500));
end;
Those 3 IDs are the boots. It'll simply select the one closest to the mouse. If you wanted it to select a random one:
procedure pSelect;
var
funcModelrray:glModelArray;
begin
writeLN('[procedure] pSelect');
if length(funcModelArray:=ogl.getModels(tCardinalArra y([940746976,432722987,3341867181]))) then
begin
if random(5)=0 then
mouse.rightClickOption(funcModelArray[random(3)].randomizePointEllipse(30),'Select')
else
mouse.click(funcModelArray[random(3)].randomizePointEllipse(30));
end;
canCross.setTime(random(1500,2500));
end;



+Rep. Great work!

Wait, what? The boots are Models not Textures on the screen??

Obscurity
08-06-2015, 07:53 PM
Look at them. They look like a model, not a texture. But yes, they're models.

Models can be drawn over an interface. Just look at the video of ogLivid (https://villavu.com/forum/showthread.php?t=113988) script. Those livids (plants) on the interface are models.

Clutch
08-06-2015, 08:13 PM
Look at them. They look like a model, not a texture. But yes, they're models.

Models can be drawn over an interface. Just look at the video of ogLivid (https://villavu.com/forum/showthread.php?t=113988) script. Those livids (plants) on the interface are models.
I never would've thought such..maybe that's why some icons on the construction interfaces wouldn't populate must be models. Thanks!

Adieux
08-06-2015, 11:46 PM
Version 2.0 is up, let me know what you guys think.

Grimxxdeath223
08-06-2015, 11:55 PM
Version 2.0 is up, let me know what you guys think.

Testing it now!!! What did you change in 2.0?

BuffaloBill
08-06-2015, 11:55 PM
Just started to test v2.0 and it cant seem to find the plank even though i was right next to it.

19:53:37 | Adieuxs PestControl v2 > setup
Were outside starting script
First game, starting script...
Reset camera
Distance from plank 91.9673855233474
We werent next to the plank, walking there now
Did not find plank model will try to locate

EDIT: Now it finds the plank but fails to click it, I manually clicked it to see if it would run better and it couldnt find the pests within the game itself.

20:06:32 | Adieuxs PestControl v2 > setup
Were outside starting script
First game, starting script...
Reset camera
Distance from plank 0
Found plank model
We failed to click, retrying
Failed to click too many times, terminating.
Clicked correctly
We made it onto the boat, cool
No antiban right now
Waiting for game to start...
Game started!
Walking to the west
We currently have a target, waiting...
No pests found rotating camera...
No pests found rotating camera...
No pests found rotating camera...
No pests found rotating camera...
No pests found rotating camera...
Couldnt find pests...walking south a bit to see if we can find anything
No pests found rotating camera...
No pests found rotating camera...
No pests found rotating camera...
No pests found rotating camera...
Couldnt find pests after multiple camera rotates, area must be clear. Waiting for next game to start
Failed to get enough damage this game
Reset camera
Distance from plank 0
Found plank model
We failed to click, retrying
Failed to click too many times, terminating.
Terminating...
Successfully executed.

Grimxxdeath223
08-07-2015, 12:05 AM
BuffaloBill; Really? It is working for me fine. I don't want to sound like a nag, but did you set everything up properly from the OP?

Adieux
08-07-2015, 12:06 AM
Testing it now!!! What did you change in 2.0?

Quite a few things just updated OP https://villavu.com/forum/showthread.php?t=114186&p=1354311#post1354311


Just started to test v2.0 and it cant seem to find the plank even though i was right next to it.

19:53:37 | Adieuxs PestControl v2 > setup
Were outside starting script
First game, starting script...
Reset camera
Distance from plank 91.9673855233474
We werent next to the plank, walking there now
Did not find plank model will try to locate

Ahh start it in the boat, theres an issue where if you dont get in the boat then leave the distance is all messed up.

Get in the boat and let me know what happens.

BuffaloBill
08-07-2015, 12:18 AM
BuffaloBill; Really? It is working for me fine. I don't want to sound like a nag, but did you set everything up properly from the OP?

Nag nag nag lol just kidding I redid my settings to exactly how they were in the OP and what do yah know, it worked perfectly clicking on the plank as well as finding targets :duh:

Also just a side note 1 game played and I got a boots pop up which it clicked through PERFECTLY so nice job on that as well!

ill post a proggy before i go to bed!

Adieux
08-07-2015, 12:19 AM
Nag nag nag lol just kidding I redid my settings to exactly how they were in the OP and what do yah know, it worked perfectly clicking on the plank as well as finding targets :duh:

Also just a side note 1 game played and I got a boots pop up which it clicked through PERFECTLY so nice job on that as well!

ill post a proggy before i go to bed!

Glad its working, let me know if anything else pops up.

BuffaloBill
08-07-2015, 12:55 AM
Distance from plank 0
Found plank model
Clicked correctly
Distance from plank 4
Found plank model
We failed to click, retrying
Error: Access violation at line 1595
Execution failed.
The following bitmaps were not freed: [0, 1]

This is the problem im having currently.

Adieux
08-07-2015, 01:21 AM
Distance from plank 0
Found plank model
Clicked correctly
Distance from plank 4
Found plank model
We failed to click, retrying
Error: Access violation at line 1595
Execution failed.
The following bitmaps were not freed: [0, 1]

This is the problem im having currently.

Yeah this is sadly an issue I'm currently working on. I've now rewritten the entire clicking procedure and will update tonight or tomorrow.

If you dont get any lag it should go on for a while with out any issues, but I'm fixing it as we speak, sorry about that!

Grimxxdeath223
08-07-2015, 01:37 AM
So many people doing PC right now because it is in the spotlight XD

Adieux
08-07-2015, 01:40 AM
So many people doing PC right now because it is in the spotlight XD

So thats why I've been getting extra thaler lol

Obscurity
08-07-2015, 01:49 AM
A few more tips. :P.


From clickOnGangPlank():
mainscreen.setDegrees(0,90);
I would not use a vertical degrees of 90. It will never reach it and just end up timing out after 2.5-5 seconds. While 90 degrees is looking straight down on your character, in most locations, the furthest you can go is approximately 52 degrees. Keep in mind, mainScreen.setDegrees() and mainScreen.setRadians() have a tolerance of about 10 degrees to make it more realistic.



From clickOnGangPlank():
if (distanceFrom > 5) and (timesResetCamera <= 1) then
//~ Stuff...
mouse.click(minimap.getScreenPosition([59,63]));
This is more an opinion then anything. A distance of 5 can be a lot. Don't quote me on this, but 5 squares from the gangplank, given the right chances, you may end up going into the medium boat. Something like three is reasonable. Again, just my opinion.

Clicking the exact coordinate on the minimap is risky. Add some randomization to it. You can do so by either adding it to the [59,63] itself or to the point returned by minimap.getScreenPosition().

mouse.click(minimap.getScreenPosition([normalRandom(56,62),normalRandom(60,66)]));
//~ Or...
mouse.click(minimap.getScreenPosition([59,63]).randomizePointEllipse(12));[
I used 12 because 1 tile is roughly 4px on the minimap.



From waitFlag and startTheGame():
//~ Stuff...
Take a look at interfaces\dialogue.simba. Is has methods for detecting all dialogues, clicking continue, getting the title, contents, prompt, selecting options, etc. It's currently undocumented, but it, as well as minimap, are my next files to be documented and rewritten.



From getClickResult() and clickOnGangPlank():
mouse.click(sentPlankTPA[0].adjustPosition(0,5).randomizePointEllipse(4));
//~ And...
mouse.click(plankTPA[0].adjustPosition(0,5).randomizePointEllipse(4));
It might be safe to also add a chance at using mouse.rightClickOption(). It returns true if the menu options was found, which could be used in place of mouse.getClick(). However, I think even right clicking will trigger mouse.getClick() if selecting 'Cross Gangplank'.



From getOntoBoat():
length(plankTPA := ogl.getClientMidPoint().closest(ogl.getModels(TCar dinalArray([1781393848,2892440677,3763942768,4136683396,416894 9912])).getVisible()));
mouse.click(plankTPA[0].adjustPosition(0,5).randomizePointEllipse(4));
This is the cause of your access violation. While you're using length(), it's not in an if statement. Therefore, there's nothing checking to ensure that plankTPA[0] even exists. So, it may be trying to adjust the position of a model that hasn't yet been drawn - which can be cause by map loading, etc.



Anyways, I'm off to bed so won't have time to comment much more. I hope you don't take this as me nagging at you. As it's your first time using ogLib (and a freaking amazing script at that regardless), I figured I'd help you out a bit and show you some methods that I didn't think you were aware of. :).

Grimxxdeath223
08-07-2015, 01:51 AM
So thats why I've been getting extra thaler lol

Right now you get 1 thaler a minute since it is in the spotlight.

Adieux
08-07-2015, 01:54 AM
Anyways, I'm off to bed so won't have time to comment much more. I hope you don't take this as me nagging at you. As it's your first time using ogLib (and a freaking amazing script at that regardless), I figured I'd help you out a bit and show you some methods that I didn't think you were aware of. :).

You have been absolutely amazing in helping me improve this and teaching me, I appreciate it so much, never nagging haha.
Will fix what you have said and update soon.

Obscurity
08-07-2015, 01:58 AM
Updated my post to show your access violation. :P.

Grimxxdeath223
08-07-2015, 02:14 AM
You have been absolutely amazing in helping me improve this and teaching me, I appreciate it so much, never nagging haha.
Will fix what you have said and update soon.

Are you going to push an update tonight? I know you are working like crazy on this.

Adieux
08-07-2015, 04:00 AM
Are you going to push an update tonight? I know you are working like crazy on this.

Just pushed out a quick fix so that you dont get access violation error, script should run decently now.

Just waiting for Obscurity to fix some ogLib functions and I will make it even better then, for now you can try version 2.1 (should update automatically)

Calluminati
08-07-2015, 06:52 AM
Setup everything identicle to you and I still get this;

07:47:09 | Adieuxs PestControl v2.1 > setup
Were outside starting script
First game, starting script...
Reset camera
Distance from plank 91.9673855233474
We werent next to the plank, walking there now

happens regardless of where i start it

Adieux
08-07-2015, 07:18 AM
Setup everything identicle to you and I still get this;

07:47:09 | Adieuxs PestControl v2.1 > setup
Were outside starting script
First game, starting script...
Reset camera
Distance from plank 91.9673855233474
We werent next to the plank, walking there now

happens regardless of where i start it

Start in the boat and let me know what you get, this usually only happens once, the firs time its ran.

Calluminati
08-07-2015, 07:27 AM
Start in the boat and let me know what you get, this usually only happens once, the firs time its ran.

Started it in the boat, same message and once the game starts it randomly rotates the camera for a while then terminates the script, I can provide a screenshot if you'd like.

Adieux
08-07-2015, 07:40 AM
Started it in the boat, same message and once the game starts it randomly rotates the camera for a while then terminates the script, I can provide a screenshot if you'd like.

Odd, no reason why it should say that it started outside.
If you would like to send me a screenshot I might be able to see something

Calluminati
08-07-2015, 07:47 AM
Odd, no reason why it should say that it started outside.
If you would like to send me a screenshot I might be able to see something

http://i.imgur.com/P4bYKOW.png
http://i.imgur.com/rGWpkL9.png

Adieux
08-07-2015, 07:54 AM
Calluminati; Not sure what could possibly be going on tbh, when you get on the boat or inside pest control and start it what does the debugger say?

The reason youre getting this error is because it thinks your far away from the gang plank. I've fixed this my self by getting on the boat, leaving and closing out Simba then relaunching. Will look into this more tomorrow since I'm rewriting most of the code.

Calluminati
08-07-2015, 08:00 AM
Calluminati; Not sure what could possibly be going on tbh, when you get on the boat or inside pest control and start it what does the debugger say?

The reason youre getting this error is because it thinks your far away from the gang plank. I've fixed this my self by getting on the boat, leaving and closing out Simba then relaunching. Will look into this more tomorrow since I'm rewriting most of the code.

Literally says this regardless of anything I do, for example starting it inside of the boat or on the island, even in lobby or logout screen it'll be identical. If there's anything I can do feel free to ask I have no problem providing screenshots or logs.

08:55:17 | Adieuxs PestControl v2.1 > setup
Were outside starting script
First game, starting script...
Reset camera
Distance from plank 91.9673855233474
We werent next to the plank, walking there now

J_R
08-07-2015, 08:22 AM
Literally says this regardless of anything I do, for example starting it inside of the boat or on the island, even in lobby or logout screen it'll be identical. If there's anything I can do feel free to ask I have no problem providing screenshots or logs.

08:55:17 | Adieuxs PestControl v2.1 > setup
Were outside starting script
First game, starting script...
Reset camera
Distance from plank 91.9673855233474
We werent next to the plank, walking there now

Try making sure the camera is in RS3 mode and not Classic, maybe that will help

Calluminati
08-07-2015, 08:30 AM
Try making sure the camera is in RS3 mode and not Classic, maybe that will help

Same issues, tried both camera types.
@BuffaloBill seems to be having the same problem I wonder if he has resolved it.

Grimxxdeath223
08-07-2015, 11:59 AM
Made it through one game and then hit massive lag because of all the people. This caused the script to click the gag plank 2 times, and then I got shot right into the game which made the access violation come up at line 1595 in method.

Calluminati
08-07-2015, 01:46 PM
Found what I think is to be the problem, I didn't swap out the pre-existing OpenGL32.dll with the ogLib one (stupidly) as I figured they would be the same. Script is working fine now so hopefully anyone having this problem will have it fixed. Will be running this script all night so I should get you a nice signature.

Grimxxdeath223
08-07-2015, 03:22 PM
It appears that there may be a decent amount of people using your script (probably because of it being in the spotlight) is there a way for you to be able to read which portals are up or down? Reason being is, say you run WEST, and that is the first portal that can be attacked. Now it is down and you (and what appears to be other people using the script) are just sitting there until the game is over. I think it would help (not just win faster but also to make sure you are over your 5k damage done and make sure the knight doesn't die) if it could run to at least one other portal or something. That is just my two cents and I am not even sure if you can read which ones are up or down. Adieux;

Adieux
08-07-2015, 05:40 PM
It appears that there may be a decent amount of people using your script (probably because of it being in the spotlight) is there a way for you to be able to read which portals are up or down? Reason being is, say you run WEST, and that is the first portal that can be attacked. Now it is down and you (and what appears to be other people using the script) are just sitting there until the game is over. I think it would help (not just win faster but also to make sure you are over your 5k damage done and make sure the knight doesn't die) if it could run to at least one other portal or something. That is just my two cents and I am not even sure if you can read which ones are up or down. Adieux;

It has supports for portals it just simply attacks which ever thing is closest to the clients mid point.
Will look to see which ID's are specifically the portals one and then make it so it stops doing anything else and just attacks those when available. This might take some time.

As for the access violation I rewrote the entire clicking on the plank to make it a lot better since the one I have right now can have problems if you lag, just need to wait for Obscurity to
fix the functions in the Include so that I can push out an update. Either tonight or tomorrow those should be fixed.

Grimxxdeath223
08-07-2015, 06:20 PM
At this rate, I might have full superior void tonight :)

Adieux
08-07-2015, 06:23 PM
At this rate, I might have full superior void tonight :)

I've been doing it for the EXP haha already got superior.

Also, just added the fix you mentioned wont be released until I fix everything this time.
Now, if you have a target and the portal is available to attack and visible the script will explicitly select to attack it instead of the pests. Seems more human like that way, and like you said should speed up games.

Grimxxdeath223
08-07-2015, 06:29 PM
I've been doing it for the EXP haha already got superior.

Also, just added the fix you mentioned wont be released until I fix everything this time.
Now, if you have a target and the portal is available to attack and visible the script will explicitly select to attack it instead of the pests. Seems more human like that way, and like you said should speed up games.

Is there a way to prioritize or maybe give the option for us to say true or false if we want to kill any spinners first? Or does that seem silly? I have watched spinners pile up and I usually manually get involved.

Adieux
08-07-2015, 06:33 PM
Is there a way to prioritize or maybe give the option for us to say true or false if we want to kill any spinners first? Or does that seem silly? I have watched spinners pile up and I usually manually get involved.

Honestly the amount of time a game of PC takes is like 2 minutes and the spinners I never noticed were a problem since everyone is usually maxed and KO's the portals in 10 seconds.

But I'll look through the ID's and see if I have time to add it in.

Grimxxdeath223
08-07-2015, 07:24 PM
Honestly the amount of time a game of PC takes is like 2 minutes and the spinners I never noticed were a problem since everyone is usually maxed and KO's the portals in 10 seconds.

But I'll look through the ID's and see if I have time to add it in.

Your probably right. A game lasts at most 3 minutes :P

Adieux
08-07-2015, 09:16 PM
Version 2.2 out now

Grimxxdeath223
08-07-2015, 09:31 PM
Version 2.2 out now

Already testing it out :spot:

We have a problem, after the minigame has finished, it says this..


Rotating to find pest
We won, +4 points
Clicking continue


I am guessing it is looking for the arrow in the chat box? I had this lowered from original testing.

Adieux
08-07-2015, 09:39 PM
Already testing it out :spot:

We have a problem, after the minigame has finished, it says this..


Rotating to find pest
We won, +4 points
Clicking continue


I am guessing it is looking for the arrow in the chat box? I had this lowered from original testing.

Yep, try to put it somewhere in the middle and see if that works, however it should be working anywhere you place it.

Grimxxdeath223
08-07-2015, 09:42 PM
Yep, try to put it somewhere in the middle and see if that works, however it should be working anywhere you place it.

26578

Grimxxdeath223
08-07-2015, 09:43 PM
Yep, try to put it somewhere in the middle and see if that works, however it should be working anywhere you place it.

26578

It isn't far off, just kinda hovers back and forth there.

Adieux
08-07-2015, 09:46 PM
26578

It isn't far off, just kinda hovers back and forth there.

here what my layout looks like
http://puu.sh/jtdC8/5c2cd1bd0c.jpg

Try something like that, see if it works. Im gonna guess it has something to do with being on top of the chat box.

Edit: Figured out the issue. I overrode the oglib function until Obscurity fixes it, and the continue button and emote button have the same ID's
This is such a weird issue, I just ran it for over an hour without any problems. Moved the chat box and now its screwed up. sighhhhh.

Grimxxdeath223
08-07-2015, 09:51 PM
Adieux; Okay, pretty much copied you exactly. Also, I still haven't gotten ANY boots, haha.

Okay... I figured out why it wasn't working, see in your picture? The continue button is right over the button to scroll through the chat options, if you move your window, it should try to click that spot again.

Adieux
08-07-2015, 10:17 PM
Adieux; Okay, pretty much copied you exactly. Also, I still haven't gotten ANY boots, haha.

Okay... I figured out why it wasn't working, see in your picture? The continue button is right over the button to scroll through the chat options, if you move your window, it should try to click that spot again.

Yep. The ID's are reused for a lot of things. For now thats the fix. I got it run like that for over an hour before it stopped because I set my games to finish to 20, rip longer proggie.
But well just have to wait until obscurity fixes the oglib function. I've tried two texture ID's so far and nothing seems to work, I'll keep trying but putting it over the continue arrows works fine tbh.

BuffaloBill
08-07-2015, 10:34 PM
Just got home from work and glad to see 2.2 out already :o Gonna test and see if anything comes up! Will edit with problems or proggies :P

On a side note I checked out your flickr and you take awesome pictures :D

Adieux
08-07-2015, 10:44 PM
Just got home from work and glad to see 2.2 out already :o Gonna test and see if anything comes up! Will edit with problems or proggies :P

On a side note I checked out your flickr and you take awesome pictures :D

Thanks man! Sadly, 2.2 has huge bug that I have to wait to fix.

BuffaloBill
08-08-2015, 01:02 AM
Thanks man! Sadly, 2.2 has huge bug that I have to wait to fix.

Pshhh bug my ass its running better than ever for me sadly after an hour simba crashed -_-

http://puu.sh/jtmzI/1461ace743.jpg

Adieux
08-08-2015, 01:30 AM
Pshhh bug my ass its running better than ever for me sadly after an hour simba crashed -_-

http://puu.sh/jtmzI/1461ace743.jpg

Awesome! thanks for the progress screen. I'm going to keep improving it, just waiting for a fix

Grimxxdeath223
08-08-2015, 01:39 AM
Where is the progress report supposed to pop up? I haven't seen it yet.

Adieux
08-08-2015, 01:41 AM
Where is the progress report supposed to pop up? I haven't seen it yet.

Click enable debug on your smart client (bottom right)

Grimxxdeath223
08-08-2015, 01:43 AM
Click enable debug on your smart client (bottom right)

26580

http://i58.tinypic.com/29nf03b.png

Now I feel silly for not knowing that...

Adieux
08-08-2015, 01:51 AM
26580

http://i58.tinypic.com/29nf03b.png

Now I feel silly for not knowing that...

Oh shit nice man, thanks for this updating OP!

Grimxxdeath223
08-08-2015, 01:55 AM
Oh shit nice man, thanks for this updating OP!

I will get a longer one tomorrow :spot: With it being this stable, point spending would be a REALLY nice added feature if it can be done, it could even just be for skills or something.

Adieux
08-08-2015, 02:14 AM
I will get a longer one tomorrow :spot: With it being this stable, point spending would be a REALLY nice added feature if it can be done, it could even just be for skills or something.

Once I finish making sure clicking continue and adding ability to use thresholds, im for sure going to get that added in

Grimxxdeath223
08-08-2015, 02:18 AM
Once I finish making sure clicking continue and adding ability to use thresholds, im for sure going to get that added in

I actually closed any window (beside the chat box) that would cause that issue with clicking continue and haven't seen it since.

BuffaloBill
08-08-2015, 01:33 PM
Post a picture of your layout? Ive tried just about everything, even moving the emote tab as its own box and it still wants to click where the emote tab used to be -_-

Grimxxdeath223
08-08-2015, 01:51 PM
Post a picture of your layout? Ive tried just about everything, even moving the emote tab as its own box and it still wants to click where the emote tab used to be -_-

http://i60.tinypic.com/wvrfvk.png

BuffaloBill
08-08-2015, 01:57 PM
Error: Access violation
Execution failed.
The following bitmaps were not freed: [0, 1]

Id love to know why I keep getting this error every 2 games and you seem to be doing fine now :P

Grimxxdeath223
08-08-2015, 02:00 PM
Update your ogLib and the two .dll that are needed. There should be a little more to that error message you get as well.

the bank
08-08-2015, 02:14 PM
Threshold abilities would take this to the next level for sure..!

BuffaloBill
08-08-2015, 02:39 PM
Update your ogLib and the two .dll that are needed. There should be a little more to that error message you get as well.

Thanks for the tip that seems to have fixed it as well as the ridiculous lag I was having :D

EDIT: Apparently not :(

In combat, waiting...
We died.
Walking to the east
In combat, waiting...
Error: Access violation
Execution failed.
The following bitmaps were not freed: [0, 1]

Grimxxdeath223
08-08-2015, 02:43 PM
Thanks for the tip that seems to have fixed it as well as the ridiculous lag I was having :D

Until they implement an updater, always check to make sure your ogLib is up to date :D

BuffaloBill
08-08-2015, 03:34 PM
Im still getting the same error

Error: Access violation
Execution failed.
The following bitmaps were not freed: [0, 1]

Is there something I could be doing wrong? Ive updated oglib and it still happens, is it running well for you?

Grimxxdeath223
08-08-2015, 03:38 PM
Im still getting the same error

Error: Access violation
Execution failed.
The following bitmaps were not freed: [0, 1]

Is there something I could be doing wrong? Ive updated oglib and it still happens, is it running well for you?

Been running for about 3 hours now with no issues (minus the knight dying, haha). Is that the whole error message?

FINALLY GOT MY FIRST PAIR OF BOOTS!!!!!!!!!!!!

BuffaloBill
08-08-2015, 03:42 PM
Been running for about 3 hours now with no issues (minus the knight dying, haha). Is that the whole error message?

Ugh lucky you! Yeah thats the whole error message which is why its confusing me.. its not really telling me what the problem is -_-

It happens after playing 2 games just about everytime and its driving me nuts

are you having a ridiculous amount of lag? Im thinking maybe thats my problem but idk why im lagging so badly, nothing else on my computer is running and iv enever had a problem with lag to this extent before

Grimxxdeath223
08-08-2015, 03:46 PM
Ugh lucky you! Yeah thats the whole error message which is why its confusing me.. its not really telling me what the problem is -_-

It happens after playing 2 games just about everytime and its driving me nuts

are you having a ridiculous amount of lag? Im thinking maybe thats my problem but idk why im lagging so badly, nothing else on my computer is running and iv enever had a problem with lag to this extent before

The only lag I am having is at the gagplank and when the game first starts, besides that everything is smooth. Has the game been idle and gone to the lobby? I have seen that lag the crap out of everything to where I have to restart the script and close my RS window.

BuffaloBill
08-08-2015, 03:48 PM
The only lag I am having is at the gagplank and when the game first starts, besides that everything is smooth. Has the game been idle and gone to the lobby? I have seen that lag the crap out of everything to where I have to restart the script and close my RS window.

Yeah it did lobby after the script terminated and thats when the lag started so restarting the client will most likely fix that but that still means that im having the error message and its not because of lag :c

So confuzed :confused:

Grimxxdeath223
08-08-2015, 03:49 PM
Yeah it did lobby after the script terminated and thats when the lag started so restarting the client will most likely fix that but that still means that im having the error message and its not because of lag :c

So confuzed :confused:

That is the limit of my ideas (maybe restart your computer???) Just have to wait for Adieux; to stop by and give some advice.

BuffaloBill
08-08-2015, 03:57 PM
That is the limit of my ideas (maybe restart your computer???) Just have to wait for Adieux; to stop by and give some advice.

haha I appreciate the help for sure, I just watched it play about 5 games even with the lag and it did everything fine and randomly after the 5th game was over it stands on the gangplank and gives the same error so something is funky on my part.. either way im sure ill figure it out eventually :P

Grimxxdeath223
08-08-2015, 04:06 PM
haha I appreciate the help for sure, I just watched it play about 5 games even with the lag and it did everything fine and randomly after the 5th game was over it stands on the gangplank and gives the same error so something is funky on my part.. either way im sure ill figure it out eventually :P

Silly question, you are using version 2.2 right? (I just have to ask) Maybe try deleting what you have and have the updater download it again.

Calluminati
08-08-2015, 05:07 PM
currently using 2.1 (disabled the updater) due to the fact 2.2 was constantly clicking the wrong spot for the "clicking continue" part

Adieux
08-08-2015, 05:23 PM
haha I appreciate the help for sure, I just watched it play about 5 games even with the lag and it did everything fine and randomly after the 5th game was over it stands on the gangplank and gives the same error so something is funky on my part.. either way im sure ill figure it out eventually :P


currently using 2.1 (disabled the updater) due to the fact 2.2 was constantly clicking the wrong spot for the "clicking continue" part

Seems like you both are using version 2.1 where I accidentally let some code pass where it would cause access violation errors.
For right now the only fix is to put your continue button over the emote button, like Grimxxdeath223; showed in the photo.

Also make sure to update your ogLib, that means download the 2 plugins as well.

I will fix the issue where it clicks the wrong place as soon as Obscurity updates ogLib, I've been talking to him and he will be doing that soon.
Just check back in a few days, whenever ogLib gets updated. The whole continue button clicking will be fixed.
Sorry for the hassle guys, thanks for using the script.

Edit: Also if you get terrible lag, restart SMART. This is caused due to going into the lobby and rejoining the game.

Grimxxdeath223
08-08-2015, 05:30 PM
http://i58.tinypic.com/16apk5x.png

This is just so far, haha. Still going.

Adieux
08-08-2015, 05:34 PM
http://i58.tinypic.com/16apk5x.png

This is just so far, haha. Still going.

Nice! Haha what noobs are you playing with that let the void knight die so much? Nah jk, its always funny seeing the people rage when the knight dies haha.

Grimxxdeath223
08-08-2015, 05:39 PM
Nice! Haha what noobs are you playing with that let the void knight die so much? Nah jk, its always funny seeing the people rage when the knight dies haha.

What can you do :p lol

Calluminati
08-08-2015, 05:45 PM
Seems like you both are using version 2.1 where I accidentally let some code pass where it would cause access violation errors.
For right now the only fix is to put your continue button over the emote button, like Grimxxdeath223; showed in the photo.

Also make sure to update your ogLib, that means download the 2 plugins as well.

I will fix the issue where it clicks the wrong place as soon as Obscurity updates ogLib, I've been talking to him and he will be doing that soon.
Just check back in a few days, whenever ogLib gets updated. The whole continue button clicking will be fixed.
Sorry for the hassle guys, thanks for using the script.

Edit: Also if you get terrible lag, restart SMART. This is caused due to going into the lobby and rejoining the game.

it's fine for the time being, just wanted superior void on my alt and full penance (amazing thaler atm) thanks for the script should be great once all the little things are fixed and it can run flawlessly.

BuffaloBill
08-08-2015, 05:48 PM
Seems like you both are using version 2.1 where I accidentally let some code pass where it would cause access violation errors.
For right now the only fix is to put your continue button over the emote button, like Grimxxdeath223; showed in the photo.

Also make sure to update your ogLib, that means download the 2 plugins as well.

I will fix the issue where it clicks the wrong place as soon as Obscurity updates ogLib, I've been talking to him and he will be doing that soon.
Just check back in a few days, whenever ogLib gets updated. The whole continue button clicking will be fixed.
Sorry for the hassle guys, thanks for using the script.

Edit: Also if you get terrible lag, restart SMART. This is caused due to going into the lobby and rejoining the game.

Im using 2.2 and it has no problem clicking the continue button. It will play a couple of games fine and then randomly give the error.. it has been very inconsistent when the error shows which is why it doesn't make sense to me.

Just to make sure im doing it right though, you have to update oglib by redownloading it and placing it in the simba folder, correct? There isnt anything else other than that, that needs to be done, right?

Adieux
08-08-2015, 05:56 PM
Im using 2.2 and it has no problem clicking the continue button. It will play a couple of games fine and then randomly give the error.. it has been very inconsistent when the error shows which is why it doesn't make sense to me.

Just to make sure im doing it right though, you have to update oglib by redownloading it and placing it in the simba folder, correct? There isnt anything else other than that, that needs to be done, right?

You need to download oglib, delete the old folder, then extract the new and rename it to just ogLib. Also download the 2 plugins on the page. And save them to your plugins folder.
Make sure they overwrite the ones already in there.

It's weird because I haven't gotten that error in 2.2 only 2.1

BuffaloBill
08-08-2015, 06:55 PM
You need to download oglib, delete the old folder, then extract the new and rename it to just ogLib. Also download the 2 plugins on the page. And save them to your plugins folder.
Make sure they overwrite the ones already in there.

It's weird because I haven't gotten that error in 2.2 only 2.1

well i did exactly as you said and so far its doing pretty well :)

Its funny watching the screen because I can point out the other bots when they are doing the exact same thing as mine XD

Adieux
08-08-2015, 07:34 PM
well i did exactly as you said and so far its doing pretty well :)

Its funny watching the screen because I can point out the other bots when they are doing the exact same thing as mine XD

Haha yeah I'm going to be making a lot of the actions more random. Will have an option to just walk up to the knight and defend, threshold abilities. Recommend some cool ideas and I'll add them
as soon as I get back from my mini vacation.

Grimxxdeath223
08-08-2015, 08:12 PM
Haha yeah I'm going to be making a lot of the actions more random. Will have an option to just walk up to the knight and defend, threshold abilities. Recommend some cool ideas and I'll add them
as soon as I get back from my mini vacation.

Nobody said you can go on vacation! You must keep updating!!! Lol

BuffaloBill
08-08-2015, 09:27 PM
Haha yeah I'm going to be making a lot of the actions more random. Will have an option to just walk up to the knight and defend, threshold abilities. Recommend some cool ideas and I'll add them
as soon as I get back from my mini vacation.

I think the obvious one is to attack portals and thats all i can think of at the moment lol and I just got the access violation again after an hour run so it is literally super random when it happens to me

Adieux
08-08-2015, 09:45 PM
I think the obvious one is to attack portals and thats all i can think of at the moment lol and I just got the access violation again after an hour run so it is literally super random when it happens to me

It does attack portals, will actually prioritize them.
So odd you're still getting that will look over the code later tonight and see if theres anything I missed.

Grimxxdeath223
08-08-2015, 09:54 PM
It does attack portals, will actually prioritize them.
So odd you're still getting that will look over the code later tonight and see if theres anything I missed.

Mine attacks portals over anything as long as they are up. I am also almost capped on pest points, haha

EDIT: So I wanted to check to see what was in my inventory since I started getting boots... and this is what I found....

http://i59.tinypic.com/2qkuxl3.png

BuffaloBill
08-08-2015, 10:35 PM
Mine attacks portals over anything as long as they are up. I am also almost capped on pest points, haha

EDIT: So I wanted to check to see what was in my inventory since I started getting boots... and this is what I found....

http://i59.tinypic.com/2qkuxl3.png

I never noticed it attack portals lol mine always seems to be attacking pests and if it cant find a pest it just stands there O_O

hahaha yeah i have about 30 of each of the boots at this point -_-

Adieux
08-08-2015, 10:52 PM
I never noticed it attack portals lol mine always seems to be attacking pests and if it cant find a pest it just stands there O_O

hahaha yeah i have about 30 of each of the boots at this point -_-

Are you sure you're using 2.2? Could you paste the code to the script here, it might have dowloaded incorrectly or something

BuffaloBill
08-08-2015, 11:08 PM
Are you sure you're using 2.2? Could you paste the code to the script here, it might have dowloaded incorrectly or something

Im using the 2.2 that your updater downloaded for me :p its driving me nuts cause i have to babysit it almost as much as if i were ACTUALLY playing haha




program AdieuxsPestControl;
{$i ogLib\lib\core\core.simba}
{

Pestcontrol Script by: Adieux at Villavu

Please make sure to visit the forum post here: https://villavu.com/forum/showthread.php?t=114186
if you have any questions or comments.

Set up is simple.
Step 1: Read the forum post
Step 2: Change the 2 Constants below to what you desire them to be
Step 3: Hit run, l
et SMART load, stop the script, log into account
Step 4: Start outside the boat near the plank, or inside the boat, or inside Pestcontrol and hit Run again
Step 5: Enable Debug in SMART if you want to see progress screen/paint

If you get any bugs or errors please report them, also please post any progress reports/give feedback.


Shoutouts to Obscurity for being such an awesome and helpful person.
This script wouldn't be nearly as good without him


Thank you for using my script!


}



//Change these to your preference

const
GAMES_TO_PLAY := 100; //Change this value to how many games you want to play, will terminate after said amount
QUICK_PRAYERS := true; //Do you want to use Quick Prayers?








//This scripts version
LOCAL_VERSION := 2.2;







var
gamesPlayed, timesResetCamera, deathCounter, timesRotatedCamera, timesCompleted, timesFailed, timesKnightDied, whereDidWeStart, scriptPaintBMP: integer;
rewardsLady, knightChatModel, damageModel, allModels, allPortals, veteranFlagModel, bootsModel: glModelArray;
failedChat: glTextureArray;
distanceFrom: extended;
paintTimer, canAttack, canRotate: tCountDown;
clientCenter: TPoint := ogl.getClientMidPoint ();
x,y: int32;
{
Override until Obscurity fixes the ID's
}

function tDialogue.clickContinue():boolean;
override;
var
funcPointer:pointer;
funcPointerIndex,
funcPointerSize:uInt32=0;
funcX,
funcY:int32;
begin
funcPointer:=glTextures(funcPointerSize)+(36*(func PointerSize-1));
if funcPointer<>nil then
begin
for funcPointerIndex to funcPointerSize-1 do
begin
if funcPointer^= 12240 then
begin
clickMouse(normalRandom((funcX:=(funcPointer+12)^)-40,funcX+40),normalRandom((funcY:=(funcPointer+16) ^)-10,funcY+10),1);
result:=true;
break;
end;
funcPointer:=funcPointer-36;
end;
end;
exit(result);
end;


{
Procedure: waitFlag;
Description: Waits for the flag on the mini-map to go away, while walking, tweaked some from original.
Credit: Ross ---> https://villavu.com/forum/member.php?u=148198
}
procedure waitFlag;
var
timeWalking: tCountDown;
begin
timeWalking.setTime(random(20000,30000));
wait(500);
while ((not ogl.getTextures(1275).isEmpty()) and (not dialogue.hasDialogue())) do
begin
wait(randomRange(500, 700));
end;
end;
{
Function: tileWalk
Description: Walks to the tiles sent to the function, has some randomization.
Credit: Ross ---> https://villavu.com/forum/member.php?u=148198
}
function tileWalk(randomization: integer; offSetTiles: TPointArray): boolean;
var
rx, ry, i: integer;
begin
for i := 0 to high(offSetTiles) do
begin
rx := randomrange( - (randomization), randomization);
ry := randomrange( - (randomization), randomization);
mouse.click(minimap.getScreenPosition(minimap.getL ocalPosition().adjustposition(offsetTiles[i].x + rx, offsetTiles[i].y + ry)), 1);
if ((offSetTiles[i].y > 20) or (offSetTiles[i].y < - 20)) or ((offSetTiles[i].x > 15) or (offSetTiles[i].x < - 15)) then
wait(3500)
else
wait(1000);
waitflag;
end;
end;
{
Function minimap.ClickResetCamera
Description: overRides ogLibs included function because it tends to miss-click a lot
changed randomizations
}
function tMinimap.clickResetCamera():boolean;
override;
var
funcPointer:pointer;
funcPointerIndex,
funcPointerSize:uInt32=0;
funcX,
funcY:int32;
begin
funcPointer:=glTextures(funcPointerSize);
if funcPointer<>nil then
begin
for funcPointerIndex to funcPointerSize-1 do
begin
if funcPointer^=147885 then
begin
clickMouse(random((funcX:=(funcPointer+12)^)-5,funcX+5),random((funcY:=(funcPointer+16)^)-5,funcY+5),1);
result:=true;
break;
end;
funcPointer:=funcPointer+36;
end;
end;
exit(result);
end;
{
Procedure: antiBan
Description: Will perform antiban, pretty simple anti ban
Just walks to somewhere on the boat, randomly.
If anyone has any other suggestions for antiban, let me know
}
procedure antiBan(doWePerform: boolean);
var
skillTab, backPackTab: glTextureArray;
skillHover: tPoint;
begin
if (doWePerform) then
begin
writeLn('Performing anti-ban');
case random(100) of
0..25:
begin
tileWalk(3, [[ - 2, - 3]]);
end;
26..50:
begin
tileWalk(3, [[3, - 3]]);
end;
51..75:
begin
tileWalk(3, [[4, 5]]);
end;
76..100:
begin
tileWalk(3, [[ - 6, 5]]);
end;
end;
end
else if (not doWePerform) then
begin
writeLn('No antiban right now');
exit;
end;
end;
{
Procedure: doWePerformAntiBan
Description: Desides if we do or do not perform antiban
most of the time will decide not to
If you prefer more anti ban, change the values below
}
procedure doWePerformAntiBan();
var
doWe: boolean;
begin
case random(100) of
0..80:
begin
doWe := false;
antiBan(doWe);
end;
81..100:
begin
doWe := true;
antiBan(doWe);
end;
end;
end;
{
Procedure: convertTheTime
Description: Converts the time from milliseconds to more formal time
receives getTimeRunning
}
function convertTheTime(time: uInt32): string;
var
seconds, minutes, hours: extended;
begin
seconds := (time mod 3600000 mod 60000 div 1000);
minutes := (time mod 3600000 div 60000);
hours := (time div 3600000);
result := (ToStr(hours) + ' hour(s) ' + toStr(minutes) + ' minutes ' + ToStr(seconds) + ' seconds');
end;
{
Procedure: progressReport
Description: Prints out a simple progress report to the use
}
procedure progressReport();
var
time: string;
pointsEarned: integer;
begin
if (paintTimer.isFinished()) then
begin
time := ConvertTheTime(GetTimeRunning());
pointsEarned := (((timesCompleted) * 4));
smart.__Graphics.Clear;
smart.__graphics.drawBitmap(scriptPaintBMP, Point(0, 465));
smart.__Graphics.DrawText('Time Running: ' + time, 'upCharsEx', point(5, 490), clWhite);
smart.__Graphics.DrawText('Points Earned: ' + toStr(pointsEarned), 'upCharsEx', point(5, 510), clAqua);
smart.__Graphics.DrawText('Times Knight Died: ' + toStr(timesKnightDied), 'upCharsEx', point(5, 530), clRed);
smart.__Graphics.DrawText('Times Failed: ' + toStr(timesFailed), 'upCharsEx', point(5, 550), clRed);
smart.__Graphics.DrawText('Version: ' + toStr(LOCAL_VERSION), 'smallChars', point(5, 580), clWhite);
paintTimer.setTime(15000);
end
else
exit;
end;
{
Procedure: terminateTheScript
Description: Terminates and frees bitmap
}
procedure terminateTheScript();
begin
FreeBitmap(scriptPaintBMP);
writeLn('Terminating...');
TerminateScript;
end;
{
Procedure: rotateCamera
Description: Rotates the camera, has a random range of rotation
}
procedure rotateCamera();
begin
wait(randomRange(200,300));
mainScreen.setDegrees(random(0, 360), random(10,50));
canRotate.setTime(random(1500,2000));
timesRotatedCamera := timesRotatedCamera + 1;
end;
{
Procedure: selectBoots
Description: Selects minigame boots randomly
Credit: Obscurity ---> https://villavu.com/forum/member.php?u=102053
}
procedure selectBoots;
begin
writeLN('[procedure] selectBoots');
if length(bootsModel := ogl.getModels(tCardinalArray([940746976,432722987,3341867181]))) then
begin
if random(5)=0 then
mouse.rightClickOption(bootsModel[random(3)].randomizePointEllipse(30),'Select')
else
mouse.click(bootsModel[random(3)].randomizePointEllipse(30));
end;
wait(randomRange(4000,5000));
dialogue.clickContinue();
end;
{
Procedure: crossGangplank
Description: Crosses the gangplank, randomly selects between right clicking
and left clicking.
}
procedure crossGangplank();
var
plankTPA: TPointArray;
begin
writeLn('Crossing plank');
if length(plankTPA := ogl.getClientMidPoint().closest(ogl.getModels(tCar dinalArray([1781393848,2892440677,3763942768,4136683396,416894 9912])))) then
begin
case random(100) of
0..100:
begin
mouse.click(plankTPA[0].adjustPosition(0,5).randomizePointEllipse(4))
end;
{ disabled for right now due to minigame spotlight causing a lot of people to play
which causes right click to be
filled with a bunch of
player names
0..:
begin
mouse.rightClickOption(plankTPA[0].adjustPosition(0,5).randomizePointEllipse(4),['Cross','Gangplank >']);
end;
}
end;
end
end;
{
Procedure: startGame
Description: Starts the game, calls crossGangplank and sets the
variables needed for the paint.
}
procedure startGame();
var
plankPosition: tPoint = [67,63];
begin

wait(RandomRange(2000,2500));
rewardsLady := ogl.getModels(1538643377);
knightChatModel := ogl.getModels(3360933869);
failedChat := ogl.getTextures(714000);
bootsModel := ogl.getModels(tCardinalArray([940746976,432722987,3341867181])).getVisible();

if (not bootsModel.isEmpty()) then
selectBoots;

if (not rewardsLady.isEmpty()) then
begin
writeLn('We won, +4 points');
timesCompleted := timesCompleted + 1;
gamesPlayed := gamesPlayed + 1;
end
else if (not knightChatModel.isEmpty()) then
begin
writeLn('Knight died, RIP.');
timesKnightDied := timesKnightDied + 1;
gamesPlayed := gamesPlayed + 1;
end
else if (not failedChat.isEmpty()) then
begin
writeLn('We failed to get enough damage, will try harder next time');
timesFailed := timesFailed + 1;
gamesPlayed := gamesPlayed + 1;
end;

if (dialogue.hasDialogue()) then
begin
writeLn('Clicking continue');
repeat
dialogue.clickContinue();
wait(randomRange(1000,1200));
until (not dialogue.hasDialogue());
end;
wait(RandomRange(1200,1500));
if (timesResetCamera < 1) then
begin
case random(100) of
0..50: begin
minimap.clickResetCamera();
timesResetCamera := timesResetCamera + 1;
end;
51..100: begin
mainscreen.setDegrees(0,50);
timesResetCamera := timesResetCamera + 1;
end;
end;
writeLn('Reset camera');
end;

distanceFrom := (minimap.getLocalPosition().distanceFrom(plankPosi tion));
if (distanceFrom > 3) and (timesResetCamera <= 1) then
begin
writeLn('Distance from plank ' + ToStr(distanceFrom) + ' walking there now');
mouse.click(minimap.getScreenPosition([67,63]).randomizePointEllipse(12));
wait(round(distanceFrom * 1000));
end;
wait(randomRange(2000,2200));
bootsModel := ogl.getModels(tCardinalArray([940746976,432722987,3341867181])).getVisible();
if (not bootsModel.isEmpty()) then
selectBoots;

crossGangplank();
end;
{
Procedure: areWeInBoat
Description: Checks for the veteran flag minigame model that shows up
when we get into the boat, if its not there will try to look
for it again, since sometimes lag causes issues, if it cant find that
checks to see if were inside pest control because sometimes
the boat leaves so fast the model doesnt show up
IF none of those two check out, will terminate.
}

procedure areWeInBoat();
begin
wait(round((2 + distanceFrom) * 500));
veteranFlagModel := ogl.getModels(3040129356);
if not veteranFlagModel.isEmpty() then
writeLn('We made it onto the boat, cool')
else if veteranFlagModel.isEmpty() then
begin
writeLn('WARNING: Did not make it onto the boat, checking one more time');
wait(randomRange(3000,5000));
veteranFlagModel := ogl.getModels(3040129356);
damageModel := ogl.getModels(2263255518);

if (not veteranFlagModel.isEmpty()) then
writeLn('We actually made it in, never mind...')
else if (not damageModel.isEmpty()) then
writeLn('Were inside pest control...LAG?')
else if (veteranFlagModel.isEmpty()) and (damageModel.isEmpty()) then
begin
writeLn('Still not in boat after searching, terminating...');
TerminateTheScript();
end;
end;
timesRotatedCamera := 0;
end;
{
Procedure: waitForGameToStart
Description: Waits until it finds the damage icon model from pest control
(thanks obscurity for the idea to use that model)
}
procedure waitForGameToStart();
var
timeWaiting: tCountDown;
begin
timeWaiting.setTime(random(240000, 270000));
doWePerformAntiBan();
writeLn('Waiting for game to start...');
actionBar.setQuickPrayer(false);
repeat
progressReport();
damageModel := ogl.getModels(2263255518);
wait(randomRange(500, 700));
until not damageModel.isEmpty() or timeWaiting.isFinished();
if (not damageModel.isEmpty()) then
writeLn('Game started!');
if timeWaiting.isFinished() then
begin
writeLn('Took too long to start game, terminating...');
TerminateTheScript();
end
else
exit;
end;
{
Procedure: whereDoWeWalkTo
Description: Decides what side of the game to walk to, favors the south more
you can change the values to whatever you want
Note: if we died, will just wait longer to start walking because of animation
}
procedure whereDoWeWalkTo();
begin
begin
damageModel := ogl.getModels(2263255518);

if damageModel.isEmpty() then
exit;

wait(RandomRange(900, 1100));
case random(60) of
0..30:
begin
wait(randomRange(1000, 1500));
writeLn('Walking to the south');
tileWalk(2, [[0, 18], [0, 10], [0, 10]]);
end;
31..45:
begin
wait(randomRange(1000, 1500));
writeLn('Walking to the west');
tileWalk(2, [[ - 10, 20], [ - 10, 5]]);
end;
46..60:
begin
wait(randomRange(1000, 1500));
writeLn('Walking to the east');
tileWalk(2, [[15, 15], [10, 10]]);
end;
end
end
end;
{
Procedure: weDied
Description: Dang we died, will just call whereDoWeWalkTo
}
procedure weDied();
begin
writeLn('We died.');
repeat
wait(randomRange(600,700));
until (actionbar.getLifePoints > 0) or (dialogue.hasDialogue());
if (not dialogue.hasDialogue()) then
whereDoWeWalkTo()
else
exit;
deathCounter := 0;
end;
{
Procedure: attackPest
Description: Clicks on the sent model, checks after clicking to see if we have
a target or not, if we do it waits till we dont, if we dont have one
will just exit
}
procedure attackPest();
var
timeAttacking: tCountDown;
pestPointArray: TPointArray;
begin
if length(pestPointArray := ogl.getClientMidPoint().closest(ogl.getModels(tCar dinalArray([1731643360,2547232634,2782989724,2899052740,348978 5670,3915285997,547053328,617765920])).getVisible())) then
begin
case random(100) of
0..50:
begin
mouse.rightClickOption(pestPointArray[0].adjustPosition(0,-25).randomizePointEllipse(20),['Attack Brawler','Attack Defiler','Attack Shifter','Attack Spinner','Attack Splatter','Attack Torcher']);
end;
51..100:
begin
mouse.click(pestPointArray[0].adjustPosition(0,-25).randomizePointEllipse(20));
end;
end;
end;
canAttack.setTime(random(1500,1800));
end;
procedure attackPortal();
var
timeAttacking: tCountDown;
portalPointArray: TPointArray;
begin
if length(portalPointArray := ogl.getClientMidPoint().closest(ogl.getModels(tCar dinalArray([2547232634, 1446295722])).getVisible())) then
begin
case random(100) of
0..50:
begin
mouse.rightClickOption(portalPointArray[0].adjustPosition(0,-25).randomizePointEllipse(20),['Attack Portal']);
end;
51..100:
begin
mouse.click(portalPointArray[0].adjustPosition(0,-25).randomizePointEllipse(20));
end;
end;
end;
canAttack.setTime(random(3000,3400));
end;
{
Procedure: insidePestControl
Description: Loop for when inside pest control, will stop looping when it
doesnt find the damage model inside of PC
(the chat box that says we failed, the lady telling us we did good, and the kngiht)
}
procedure insidePestControl();
var
timeSpentInGame, timeWaitingForNewGame: tCountDown;
begin
timesResetCamera := 0;
whereDoWeWalkTo();
mainScreen.setDegrees(random(0,20),random(10,20));
actionbar.setQuickPrayer(QUICK_PRAYERS);
timeSpentInGame.setTime(random(360000, 420000));
repeat

progressReport();
allModels := ogl.getModels(TCardinalArray([1731643360,2782989724,2899052740,3489785670,391528 5997,547053328,617765920])).getVisible();
allPortals := ogl.getModels(TCardinalArray([2547232634, 1446295722])).getVisible();
damageModel := ogl.getModels(2263255518);
if (not allPortals.isEmpty()) and (canAttack.isFinished()) then
attackPortal()
else if (combat.hasTarget()) then
begin
writeLn('In combat, waiting...');
repeat
wait(RandomRange(500,600));
allPortals := ogl.getModels(TCardinalArray([2547232634, 1446295722])).getVisible();
damageModel := ogl.getModels(2263255518);
until (not combat.hasTarget()) or (timeSpentInGame.isFinished()) or (actionbar.getLifePoints <= 0) or (not allPortals.isEmpty()) or (damageModel.isEmpty());
end
else if (not combat.hasTarget()) then
begin
if (allModels.isEmpty()) and (canRotate.isFinished()) then
begin
writeLn('Rotating to find pest');
rotateCamera();
end
else if (not allModels.isEmpty()) and (canAttack.isFinished()) then
attackPest();
end;

if (actionbar.getLifePoints <= 0) then
weDied();

if (timesRotatedCamera = 5) then
begin
writeLn('Couldnt find pests...walking south a bit to see if we can find anything');
tileWalk(2, [[0, 8]]);
timesRotatedCamera := timesRotatedCamera + 1;
end;

until (timeSpentInGame.isFinished()) or (dialogue.hasDialogue()) or (timesRotatedCamera >= 10);

if (timesRotatedCamera >= 10) then
begin
writeLn('Couldnt find pests after multiple camera rotates, waiting for new game [area most likely clear]');
actionbar.setQuickPrayer(false);
timeWaitingForNewGame.setTime(random(210000,230000 ));
repeat
wait(RandomRange(500,600));
damageModel := ogl.getModels(2263255518);
until (timeWaitingForNewGame.isFinished()) or (damageModel.isEmpty());

if (timeWaitingForNewGame.isFinished()) then
begin
writeLn('Game took too long to start again');
terminateTheScript();
end;
end;

if (timeSpentInGame.isFinished()) then
begin
writeLn('Time in game lasted too long');
terminateTheScript();
end;
end;
{
Procedure: whereAreWe();
Description: Detects where we are based on certain models
will call the appropriate procedure or function
(only runs once)
}
procedure whereAreWe();
begin
wait(randomRange(500, 600));
veteranFlagModel := ogl.getModels(3040129356);
damageModel := ogl.getModels(2263255518);
if (veteranFlagModel.isEmpty()) and (damageModel.isEmpty()) then
begin
writeLn('Were outside starting script');
whereDidWeStart := 1;
end
else if (not veteranFlagModel.isEmpty()) then
begin
writeLn('Were in the boat...starting script');
whereDidWeStart := 2;
end
else if (not damageModel.isEmpty()) then
begin
writeLn('Were inside pestcontrol...starting script');
whereDidWeStart := 3;
end;
end;
{
Procedure: autoUpdateMe();
Description: Checks to see if you have the lastest version of the script
Credit: Fady --> https://villavu.com/forum/member.php?u=152795
}
procedure autoUpdateMe();
var
newFile: integer;
newScript, newFilePath: string;
online_Version: extended;
begin
writeLn('Checking for updates...');
online_Version := strToFloat(getPage('http://static.frement.net/proxy.php?u=https://raw.githubusercontent.com/Introvertt/Adieuxs-Pestcontrol/master/Version.txt'));
writeLn('Local Version ' + toStr(LOCAL_VERSION) + ', Online Version: ' + toStr(online_Version)+'.');

if online_Version > Local_Version then
begin
writeLn('Downloading the latest script version from GitHub');
newScript := getPage('http://static.frement.net/proxy.php?u=https://raw.githubusercontent.com/Introvertt/Adieuxs-Pestcontrol/master/Adieuxs%20Pestcontrol.simba');
newFilePath := scriptPath+ 'Adieuxs Pestcontrol v' + toStr(online_Version) +'.simba';
newFile := rewriteFile(newFilePath, true);

if not writeFileString(newFile, newScript) then
begin
writeLn('Could not write to ' + newFilePath);
terminateTheScript();
end;

closeFile(newFile);
writeLn('Latest script downloaded to ' + newFilePath);
writeLn('Please use the new one to run the latest version!');
terminateScript();
end else
writeLn('Local version is already up to date!');
end;
begin

autoUpdateMe();
ogl.setup();
GLXViewPort(x,y,x,y);
ogl.setDebugMode(0);
scriptPaintBMP := loadBitmap( AppPath + 'scripts\Adieuxs Pestcontrol\AdieuxsPestcontrolPaint.jpg');
whereAreWe();
repeat

case (whereDidWeStart) of
1: begin
startGame();
areWeInBoat();
waitForGameToStart();
insidePestControl();
whereDidWeStart := 0
end;
2: begin
waitForGameToStart();
insidePestControl();
whereDidWeStart := 0;
end;
3: begin
insidePestControl();
whereDidWeStart := 0;
end;
end;

startGame();
areWeInBoat();
waitForGameToStart();
insidePestControl();

until (gamesPlayed = GAMES_TO_PLAY);

if (gamesPlayed = GAMES_TO_PLAY) then
begin
ClearDebug();
writeLn('We finished playing all our games. Terminating');
TerminateTheScript();
end;

end.

Grimxxdeath223
08-08-2015, 11:21 PM
BuffaloBill; That is so odd cause I have the exact opposite thing going on.

Adieux
08-08-2015, 11:21 PM
BuffaloBill; thats strange it should be attacking portals and you shouldn't be getting access violation errors.

But if it does ever terminate from access violation errors your account would just be auto logged out after 5 min.
So you shouldn't worry about staying logged in, Ive also got a few failsafes and will be adding a lot more soon.

BuffaloBill
08-08-2015, 11:25 PM
Oh yeah im not worried staying logged in at all im just babysitting because i talk to my clan while it does its thing and I restart it when it terminates lol

and strange is an understatement, grim is having no problems and im having all the problems :P I wish I had feedback from other people having this issue so I knew it wasnt just me because i feel like im doing something wrong -_-

It did tell me the line where the access violation was coming from once but I forgot to copy and paste it soooo im screwed haha

Grimxxdeath223
08-08-2015, 11:28 PM
Adieux; The only issue i've seen, which really isn't an issue, is this. Say we go east or west, and now that is the first portal to come up, very rarely will you not get the 5k zeal and then just sit there because everything has died. This is usually when I step in and run somewhere else to just make sure I get my points. This, like I said, happens rarely. I know it will run south to try and find more pests, but sometimes it just doesn't see them. Again, very rare. Also, I am up to 879 commendations and 589 thaler atm :spot::spot::spot::spot:

Adieux
08-08-2015, 11:34 PM
Adieux; The only issue i've seen, which really isn't an issue, is this. Say we go east or west, and now that is the first portal to come up, very rarely will you not get the 5k zeal and then just sit there because everything has died. This is usually when I step in and run somewhere else to just make sure I get my points. This, like I said, happens rarely. I know it will run south to try and find more pests, but sometimes it just doesn't see them. Again, very rare. Also, I am up to 879 commendations and 589 thaler atm :spot::spot::spot::spot:

Damn thats a lot. Im going to work on that issue, as I've noticed it too (why going south is more common in the script)
I'll probably add it in so that if that portal is dead it will try to go to another one, it will take some time.

Also, Obscurity just sent me a fix for the continue chat issue. Will test when I get to the hotel and if it works I'll push out a quick update.

BuffaloBill
08-08-2015, 11:41 PM
Damn thats a lot. Im going to work on that issue, as I've noticed it too (why going south is more common in the script)
I'll probably add it in so that if that portal is dead it will try to go to another one, it will take some time.

Also, Obscurity just sent me a fix for the continue chat issue. Will test when I get to the hotel and if it works I'll push out a quick update.

Maybe the quick fix will randomly fix my issue too! *hopeful thinking* :thumbsup:

Grimxxdeath223
08-09-2015, 12:40 AM
I am SO pissed. I was going to get a nice screen shot with 1k points but my inventory filled up and it couldn't take the boots so it terminated. At least I got the proggy.

http://i57.tinypic.com/122c9xl.png

Grimxxdeath223
08-09-2015, 06:08 PM
No activity today? *GASP* Well, so far I have gotten full superior void and roughly 4.5 million exp along with fully charged silverhawk boots. Too bad this is only in the spotlight for 3 days.

BuffaloBill
08-09-2015, 07:03 PM
No activity today? *GASP* Well, so far I have gotten full superior void and roughly 4.5 million exp along with fully charged silverhawk boots. Too bad this is only in the spotlight for 3 days.

I just finished full sup on all helmets and im working on getting the last 30 thaler for silver hawks but im playing legit :O

Grimxxdeath223
08-09-2015, 07:05 PM
I just finished full sup on all helmets and im working on getting the last 30 thaler for silver hawks but im playing legit :O

le...leg.....LEGIT!?!? Quick somebody get this guy something to drink! Lol. I am at work so I am just looking at it remotely and it appears to be going fine. Got 1,166 agility xp so far :spot:

Adieux
08-09-2015, 10:07 PM
No activity today? *GASP* Well, so far I have gotten full superior void and roughly 4.5 million exp along with fully charged silverhawk boots. Too bad this is only in the spotlight for 3 days.

Yeah haha I just landed in DR going to get really drunk and push out an update later tonight!

Grimxxdeath223
08-09-2015, 10:18 PM
Yeah haha I just landed in DR going to get really drunk and push out an update later tonight!

Yay working vacation! But seriously, don't work on your vacation over us (unless coding is like vacation then do a bunch of it haha)

Calluminati
08-09-2015, 10:49 PM
Actually completed my superior void on this today, shame I couldn't upload a proggy as it would fail a lot of the time, anyways thanks.

Adieux
08-10-2015, 03:12 AM
Update: I am gettin 0.5 Mbps download speeds at this resort and wont be able to update the script till friday est.

I also brought my shitty macbook air and trying to download windows with this download speed is impossible.

If you want to try and fix it yourself, replace the dialouge.clickContinue(); in my script
With this

function tDialogue.clickContinue():boolean;
override;
var
funcPointer:^glTexture;
funcPointerSize:uInt32;
begin
funcPointer:=glTextures(funcPointerSize)+(oglTextu reSize*(funcPointerSize-2));
for 1 to funcPointerSize-1 do
begin
if funcPointer^.id=142800 then
begin
mouse.click(funcPointer^.bounds);
result:=true;
break;
end;
funcPointer-=oglTextureSize;
end;
exit(result);
This should fix the issue where it doesn't click the correct continue area, and might fix access violation

This was sent to me by obscurity since he cant update oglib to fix the continue functions, hasn't been tested since he is also away.
When I get back I will be back to working on this a lot more, will be adding a lot of cool new features and fixing other bugs.

recs7168
08-15-2015, 12:18 AM
I am getting tons of Access violations. To the point where I can longer even finish one game anymore. Sometimes it occurs right after going into combat. One time it occurred after attacking a portal.

Grimxxdeath223
08-15-2015, 12:37 AM
I am getting tons of Access violations. To the point where I can longer even finish one game anymore. Sometimes it occurs right after going into combat. One time it occurred after attacking a portal.

Make sure you have the latest ogLib update installed.

Adieux
08-15-2015, 08:32 PM
Version 2.3 out now

New stuff:
1. Threshold and Ultimate abilities support!
2. Will now activate auto retaliate if you forget to enable it

Fixes:
1. Clicking of continue is now fixed
2. Fixed some access violation errors
3. Fixed an issue where it would get stuck on boot screen some times

Please let me know if you encounter any bugs/issues

BuffaloBill
08-15-2015, 10:06 PM
Version 2.3 out now

New stuff:
1. Threshold and Ultimate abilities support!
2. Will now activate auto retaliate if you forget to enable it

Fixes:
1. Clicking of continue is now fixed
2. Fixed some access violation errors
3. Fixed an issue where it would get stuck on boot screen some times

Please let me know if you encounter any bugs/issues

Nice! Glad to see the new stuff and of course the fixes are always appreciated :) Unfortunately I got my superior void so i dont have much need for pc atm but ill def be trying it out soon!

Adieux
08-16-2015, 12:09 AM
Nice! Glad to see the new stuff and of course the fixes are always appreciated :) Unfortunately I got my superior void so i dont have much need for pc atm but ill def be trying it out soon!

Aye thats awesome!

theorange
08-23-2015, 02:21 PM
Error: Access violation at line 711
Execution failed.
The following bitmaps were not freed: [0, 1]
if (funcPointer^.id=79816) and (funcPointer^.colourID=15419436) then

Was failing to find pests also, never found a pest on its own.

Adieux
08-25-2015, 02:54 AM
Error: Access violation at line 711
Execution failed.
The following bitmaps were not freed: [0, 1]
if (funcPointer^.id=79816) and (funcPointer^.colourID=15419436) then

Was failing to find pests also, never found a pest on its own.

Odd, are you sure you are using the correct settings?

I have never had an issue with not finding pests, unless they changed the ID's in the past 2 weeks which is highly unlikely.

What resolution are you running on? Have you installed the plugins and made sure to have the updated ogLib version downloaded?

theorange
08-26-2015, 03:35 AM
Odd, are you sure you are using the correct settings?

I have never had an issue with not finding pests, unless they changed the ID's in the past 2 weeks which is highly unlikely.

What resolution are you running on? Have you installed the plugins and made sure to have the updated ogLib version downloaded?
I have it working now with the update you the original post with the 3D model change.

However, once a game is over, it does not recognize that the game is over, still thinks it is in the game, clicking all over.

-- Also this happened
http://imgur.com/d5wrxCz

jochang2014
08-27-2015, 06:44 PM
I am new to this so I can't tell what was happening here. Any help will be appreciated.

Error: Forwarded declaration doesn't match at line 128
Compiling failed.

---
122 {
123 Function minimap.ClickResetCamera
124 Description: overRides ogLibs included function because it tends to miss-click a lot
125 changed randomizations
126 }
127 function tMinimap.clickResetCamera():boolean;
128 override;

Adieux
08-27-2015, 07:45 PM
I am new to this so I can't tell what was happening here. Any help will be appreciated.

Error: Forwarded declaration doesn't match at line 128
Compiling failed.

---
122 {
123 Function minimap.ClickResetCamera
124 Description: overRides ogLibs included function because it tends to miss-click a lot
125 changed randomizations
126 }
127 function tMinimap.clickResetCamera():boolean;
128 override;

So this is probably an issue because ogLib was just recently updated.
Give me till the end of today and I'll fix, just have to change some things

Edit: jochang2014; Script updated, delete version 2.3 and run auto updater.
Should be downloadable in 10 minutes

jochang2014
08-27-2015, 09:10 PM
Thanks!Will try it.

Adieux
08-27-2015, 09:21 PM
Version 2.4 out now

New stuff:
Nothing

Fixes:
1. Updated script to work with new version of ogLib

IMPORTANT Make sure to update ogLib, delete the old folder, replace, etc...

Please let me know if you encounter any bugs/issues

Grimxxdeath223
08-28-2015, 05:03 PM
Version 2.4 out now

New stuff:
Nothing



I saw new stuff and was like :surprised: but only to find out there was nothing new :f:

Adieux
08-28-2015, 05:06 PM
I saw new stuff and was like :surprised: but only to find out there was nothing new :f:

Haha yeah sadly getting prepared for new semester in college is weighing on my scripting time.

Grimxxdeath223
08-28-2015, 05:09 PM
Haha yeah sadly getting prepared for new semester in college is weighing on my scripting time.

No worries. The only addition needed here is point spending just in case you reach point cap. Beside that this script is awesome.

Adieux
08-29-2015, 01:30 AM
No worries. The only addition needed here is point spending just in case you reach point cap. Beside that this script is awesome.

I got motivated and am working on a cannon ball smelter for port phasmatys and should be done later tonight so thats cool I guess

Grimxxdeath223
08-29-2015, 12:43 PM
I got motivated and am working on a cannon ball smelter for port phasmatys and should be done later tonight so thats cool I guess

Great, now I need to get pants and make cannonballs :p

meebington
09-07-2015, 12:52 AM
I need some help. The script was working, but after running it for half an hour or so it ran into an access restriction. Every time the access restriction was different and didn't reoccur. Now after reinstalling java(in an effort to fix access restrictions) the script outputs "Distance from plank 91.9673855233474 walking there now". The distance is always exactly the same no matter where the script is started from. I have reinstalled/changed just about everything with the exact same result.

Anish
09-14-2015, 02:48 AM
Pretty sure this isnt a problem with your script, but it seems like it doesnt run
http://prntscr.com/8g36ey

Obscurity
09-14-2015, 04:51 AM
That will be fixed by Ross in the next ogLib update. For now, just delete the override;

recs7168
09-14-2015, 01:31 PM
Just made the switch to 2.4 before the old 2.4 did not compile. I re-integrated ogLib so now 2.4 compiles but it doesn't start a client when I run the script. How do I get the client up?

Obscurity
09-14-2015, 02:04 PM
Does a console window appear and then disappear fairly quickly?

recs7168
09-15-2015, 03:58 AM
Never mind, I got it to work. However, there is an access violation that occurs in method every once in a while. Not every game. Normally happens after three games but it has run for hours before.

Error: Access violation at line 561

Line 561 in method: begin exit(tPoint([self.x,self.y]));end;

Occasionally one will occur in actionBar too.

Line 718: if (funcPointer^.id=79816) and (funcPointer^.colourID=15419436) then


---
Aside from errors,

I've been running this for almost 9000 points. Approximated from the 1100+ thalor I have and having never played during spotlight.

In 2.3, the actionBar method occurred often. But normally wouldn't occur until late (around the 50+ games). Also, the script would also take me to the main island and then fail pretty often. Have not tested 2.4 enough to see if this still happens.

In 2.4, I've been able to run for 4 hours once. But for now, errors pop up after a handful of games.

Big Dennis
10-28-2015, 04:34 PM
I have a problem when starting up the script:
Error: Expected variable of type "array [0..1] of Int32", got "Int32" at line 748, column 12 at line 748
Compiling failed.

Guiri
11-04-2015, 07:54 AM
Error: Expected variable of type "array [0..1] of Int32", got "Int32" at line 748, column 12 at line 748
Compiling failed.



ogl.setup();

chickenfoot911
11-10-2015, 04:30 AM
Error: Expected variable of type "array [0..1] of Int32", got "Int32" at line 748, column 12 at line 748
Compiling failed.



ogl.setup();


You need to pass values in, so it should be ogl.setup(800,600);



I'm having issues even getting the script started.

Here's the message I'm getting:

22:36:25 | Adieuxs PestControl v2.4 > debug
22:36:25 | Adieuxs PestControl v2.4 > tSmart.setPair() successful
Were outside starting script
Reset camera
Crossing plank
WARNING: Did not make it onto the boat, checking one more time
Still not in boat after searching, terminating...
Terminating...
Successfully executed.

It's not crossing the plank, and so it just terminates. Sometimes it goes 2 squares away towards the island and fails like this:
https://gyazo.com/761128eee62419d02e02f676e4301ebf

I have it all correctly set up, and latest versions of ogLib and other files.

Spectral
12-18-2015, 03:50 AM
Never mind, I got it to work. However, there is an access violation that occurs in method every once in a while. Not every game. Normally happens after three games but it has run for hours before.

Error: Access violation at line 561

Line 561 in method: begin exit(tPoint([self.x,self.y]));end;

Occasionally one will occur in actionBar too.

Line 718: if (funcPointer^.id=79816) and (funcPointer^.colourID=15419436) then


---
Aside from errors,

I've been running this for almost 9000 points. Approximated from the 1100+ thalor I have and having never played during spotlight.

In 2.3, the actionBar method occurred often. But normally wouldn't occur until late (around the 50+ games). Also, the script would also take me to the main island and then fail pretty often. Have not tested 2.4 enough to see if this still happens.

In 2.4, I've been able to run for 4 hours once. But for now, errors pop up after a handful of games.

Hey bro, did you figure out how to make this run? I am still getting the same error and wish to fix it

chickenfoot911
12-18-2015, 04:09 PM
For those looking for a fix to all the compiling and graphical errors, this got it working for me.


program AdieuxsPestControl;
{$i ogLib\lib\core\core.simba}
{
Pestcontrol Script by: Adieux at Villavu

Please make sure to visit the forum post here: https://villavu.com/forum/showthread.php?t=114186
if you have any questions or comments.

Set up is simple.
Step 1: Read the forum post
Step 2: Change the 2 Constants below to what you desire them to be
Step 3: Hit run, let SMART load, stop the script, log into account
Step 4: Start outside the boat near the plank, or inside the boat, or inside Pestcontrol and hit Run again
Step 5: Enable Debug in SMART if you want to see progress screen/paint

If you get any bugs or errors please report them, also please post any progress reports/give feedback.


Shoutouts to Obscurity for being such an awesome and helpful person.
This script wouldn't be nearly as good without him


Thank you for using my script!
}

////////////////////////////IMPORTANT SETUP////////////////////////////////////////////////////////////////////////////////////////////

const
GAMES_TO_PLAY := 200; //Change this value to how many games you want to play, will terminate after said amount
QUICK_PRAYERS := false; //Do you want to use Quick Prayers?
USING_ABILITIES := false; //Do you want to use abilities? If false, then ignore the bottom bit.


///Fill out if using abilities, just input the name of the ability you're using, ability bar must be open and ability must be on bar
//DO NOT USE SPACES, OR CAPITALIZE
THRESHOLD_1 := '';
THRESHOLD_2 := '';
THRESHOLD_3 := '';
THRESHOLD_4 := '';
ULTIMATE := 'metamorphosis';
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//This scripts version
LOCAL_VERSION := 2.4;







var
gamesPlayed, timesResetCamera, deathCounter, timesRotatedCamera, timesCompleted, timesFailed, timesKnightDied, whereDidWeStart, scriptPaintBMP: integer;
rewardsLady, knightChatModel, damageModel, allModels, allPortals, veteranFlagModel, bootsModel: glModelArray;
failedChat: glTextureArray;
distanceFrom: extended;
paintTimer, canAttack, canRotate, canUseAbility: tCountDown;
ability: char;
clientCenter: TPoint := ogl.getClientMidPoint ();
x,y: int32;
{
Override until Obscurity fixes the ID's
}

function tDialogue.clickContinue():boolean;
override;
var
funcPointer:^glTexture;
funcPointerSize:uInt32;
begin
funcPointer:=glTextures(funcPointerSize)+(oglTextu reSize*(funcPointerSize-2));
for 1 to funcPointerSize-1 do
begin
if funcPointer^.id=142800 then
begin
mouse.click(funcPointer^.bounds);
result:=true;
break;
end;
funcPointer-=oglTextureSize;
end;
exit(result);
end;
{
Procedure: waitFlag;
Description: Waits for the flag on the mini-map to go away, while walking, tweaked some from original.
Credit: Ross ---> https://villavu.com/forum/member.php?u=148198
}
procedure waitFlag;
var
timeWalking: tCountDown;
begin
timeWalking.setTime(random(20000,30000));
wait(500);
while ((not ogl.getTextures(1275).isEmpty()) and (not damageModel.isEmpty()) and (not timeWalking.isFinished())) do
begin
wait(randomRange(500, 700));
damageModel := ogl.getModels(2263255518);
end;
end;
{
Function: tileWalk
Description: Walks to the tiles sent to the function, has some randomization.
Credit: Ross ---> https://villavu.com/forum/member.php?u=148198
}
function tileWalk(randomization: integer; offSetTiles: TPointArray): boolean;
var
rx, ry, i: integer;
begin
for i := 0 to high(offSetTiles) do
begin
rx := randomrange( - (randomization), randomization);
ry := randomrange( - (randomization), randomization);
mouse.click(minimap.getScreenPosition(minimap.getL ocalPosition().adjustposition(offsetTiles[i].x + rx, offsetTiles[i].y + ry)), 1);
if ((offSetTiles[i].y > 20) or (offSetTiles[i].y < - 20)) or ((offSetTiles[i].x > 15) or (offSetTiles[i].x < - 15)) then
wait(3500)
else
wait(1000);
waitflag;
end;
end;
{
Procedure: antiBan
Description: Will perform antiban, pretty simple anti ban
Just walks to somewhere on the boat, randomly.
If anyone has any other suggestions for antiban, let me know
}
procedure antiBan(doWePerform: boolean);
var
skillTab, backPackTab: glTextureArray;
skillHover: tPoint;
begin
if (doWePerform) then
begin
writeLn('Performing anti-ban');
case random(100) of
0..25:
begin
tileWalk(3, [[ - 2, - 3]]);
end;
26..50:
begin
tileWalk(3, [[3, - 3]]);
end;
51..75:
begin
tileWalk(3, [[4, 5]]);
end;
76..100:
begin
tileWalk(3, [[ - 6, 5]]);
end;
end;
end
else if (not doWePerform) then
begin
writeLn('No antiban right now');
exit;
end;
end;
{
Procedure: doWePerformAntiBan
Description: Desides if we do or do not perform antiban
most of the time will decide not to
If you prefer more anti ban, change the values below
}
procedure doWePerformAntiBan();
var
doWe: boolean;
begin
case random(100) of
0..80:
begin
doWe := false;
antiBan(doWe);
end;
81..100:
begin
doWe := true;
antiBan(doWe);
end;
end;
end;
{
Procedure: convertTheTime
Description: Converts the time from milliseconds to more formal time
receives getTimeRunning
}
function convertTheTime(time: uInt32): string;
var
seconds, minutes, hours: extended;
begin
seconds := (time mod 3600000 mod 60000 div 1000);
minutes := (time mod 3600000 div 60000);
hours := (time div 3600000);
result := (ToStr(hours) + ' hour(s) ' + toStr(minutes) + ' minutes ' + ToStr(seconds) + ' seconds');
end;
{
Procedure: progressReport
Description: Prints out a simple progress report to the use
}
procedure progressReport();
var
time: string;
pointsEarned: integer;
begin
if (paintTimer.isFinished()) then
begin
time := ConvertTheTime(GetTimeRunning());
pointsEarned := (((timesCompleted) * 4));
smart.Graphics.Clear;
smart.graphics.drawBitmap(scriptPaintBMP, Point(0, 465));
smart.Graphics.DrawText('Time Running: ' + time, 'upCharsEx', point(5, 490), clWhite);
smart.Graphics.DrawText('Points Earned: ' + toStr(pointsEarned), 'upCharsEx', point(5, 510), clAqua);
smart.Graphics.DrawText('Times Knight Died: ' + toStr(timesKnightDied), 'upCharsEx', point(5, 530), clRed);
smart.Graphics.DrawText('Times Failed: ' + toStr(timesFailed), 'upCharsEx', point(5, 550), clRed);
smart.Graphics.DrawText('Version: ' + toStr(LOCAL_VERSION), 'smallChars', point(5, 580), clWhite);
paintTimer.setTime(15000);
end
else
exit;
end;
{
Procedure: terminateTheScript
Description: Terminates and frees bitmap
}
procedure terminateTheScript();
begin
FreeBitmap(scriptPaintBMP);
writeLn('Terminating...');
TerminateScript;
end;
{
Procedure: rotateCamera
Description: Rotates the camera, has a random range of rotation
}
procedure rotateCamera();
begin
wait(randomRange(200,300));
mainScreen.setDegrees(random(0, 360), random(10,35));
canRotate.setTime(random(1500,2000));
timesRotatedCamera := timesRotatedCamera + 1;
end;
{
Procedure: selectBoots
Description: Selects minigame boots randomly
Credit: Obscurity ---> https://villavu.com/forum/member.php?u=102053
}
procedure selectBoots;
begin
writeLN('[procedure] selectBoots');
if length(bootsModel := ogl.getModels(tCardinalArray([940746976,432722987,3341867181]))) then
begin
if random(5)=0 then
mouse.rightClickOption(bootsModel[random(3)].randomizePointEllipse(30),'Select')
else
mouse.click(bootsModel[random(3)].randomizePointEllipse(30));
end;
wait(randomRange(4000,5000));
dialogue.clickContinue();
wait(randomRange(1500,2000));
end;
{
Procedure: crossGangplank
Description: Crosses the gangplank, randomly selects between right clicking
and left clicking.
}
procedure crossGangplank();
var
modelArray: glModelArray;
plankModel: glModelArray;
begin
writeLn('Crossing plank');
begin
case random(100) of
0..100:
begin
modelArray := ogl.getModels(tCardinalArray([1781393848,2892440677,3763942768,4136683396,416894 9912]));
plankModel := modelArray.closestTo(ogl.getclientMidPoint());
plankModel[0].toPoint();
mouse.click(plankModel[0].adjustPosition(0,5).randomizePointEllipse(4))
end;
{ disabled for right now due to minigame spotlight causing a lot of people to play
which causes right click to be
filled with a bunch of
player names
0..:
begin
mouse.rightClickOption(plankTPA[0].adjustPosition(0,5).randomizePointEllipse(4),['Cross','Gangplank >']);
end;
}
end;
end
end;
{
Procedure: startGame
Description: Starts the game, calls crossGangplank and sets the
variables needed for the paint.
}
procedure startGame();
var
plankPosition: tPoint = [67,63];
begin

wait(RandomRange(2000,2500));
rewardsLady := ogl.getModels(1538643377);
knightChatModel := ogl.getModels(3360933869);
failedChat := ogl.getTextures(714000);
bootsModel := ogl.getModels(tCardinalArray([940746976,432722987,3341867181])).getVisible();

if (not bootsModel.isEmpty()) then
selectBoots;

if (not rewardsLady.isEmpty()) then
begin
writeLn('We won, +4 points');
timesCompleted := timesCompleted + 1;
gamesPlayed := gamesPlayed + 1;
end
else if (not knightChatModel.isEmpty()) then
begin
writeLn('Knight died, RIP.');
timesKnightDied := timesKnightDied + 1;
gamesPlayed := gamesPlayed + 1;
end
else if (not failedChat.isEmpty()) then
begin
writeLn('We failed to get enough damage, will try harder next time');
timesFailed := timesFailed + 1;
gamesPlayed := gamesPlayed + 1;
end;

if (dialogue.hasDialogue()) then
begin
writeLn('Clicking continue');
repeat
dialogue.clickContinue();
wait(randomRange(1000,1200));
until (not dialogue.hasDialogue());
end;
wait(RandomRange(1200,1500));
if (timesResetCamera < 1) then
begin
case random(100) of
0..50: begin
minimap.clickResetCamera();
timesResetCamera := timesResetCamera + 1;
end;
51..100: begin
mainscreen.setDegrees(0,50);
timesResetCamera := timesResetCamera + 1;
end;
end;
writeLn('Reset camera');
end;

distanceFrom := (minimap.getLocalPosition().distanceFrom(plankPosi tion));
if (distanceFrom > 3) and (timesResetCamera <= 1) then
begin
writeLn('Distance from plank ' + ToStr(distanceFrom) + ' walking there now');
mouse.click(minimap.getScreenPosition([67,63]).randomizePointEllipse(12));
wait(round(distanceFrom * 1000));
end;
wait(randomRange(2000,2200));
bootsModel := ogl.getModels(tCardinalArray([940746976,432722987,3341867181])).getVisible();
if (not bootsModel.isEmpty()) then
selectBoots;

crossGangplank();
end;
{
Procedure: areWeInBoat
Description: Checks for the veteran flag minigame model that shows up
when we get into the boat, if its not there will try to look
for it again, since sometimes lag causes issues, if it cant find that
checks to see if were inside pest control because sometimes
the boat leaves so fast the model doesnt show up
IF none of those two check out, will terminate.
}

procedure areWeInBoat();
begin
wait(round((2 + distanceFrom) * 500));
veteranFlagModel := ogl.getModels(3040129356);
if not veteranFlagModel.isEmpty() then
writeLn('We made it onto the boat, cool')
else if veteranFlagModel.isEmpty() then
begin
writeLn('WARNING: Did not make it onto the boat, checking one more time');
wait(randomRange(3000,5000));
veteranFlagModel := ogl.getModels(3040129356);
damageModel := ogl.getModels(2263255518);

if (not veteranFlagModel.isEmpty()) then
writeLn('We actually made it in, never mind...')
else if (not damageModel.isEmpty()) then
writeLn('Were inside pest control...LAG?')
else if (veteranFlagModel.isEmpty()) and (damageModel.isEmpty()) then
begin
writeLn('Still not in boat after searching, terminating...');
TerminateTheScript();
end;
end;
timesRotatedCamera := 0;
end;
{
Procedure: waitForGameToStart
Description: Waits until it finds the damage icon model from pest control
(thanks obscurity for the idea to use that model)
}
procedure waitForGameToStart();
var
timeWaiting: tCountDown;
begin
timeWaiting.setTime(random(240000, 270000));
doWePerformAntiBan();
writeLn('Waiting for game to start...');
actionBar.setQuickPrayer(false);
repeat
progressReport();
damageModel := ogl.getModels(2263255518);
wait(randomRange(500, 700));
until not damageModel.isEmpty() or timeWaiting.isFinished();
if (not damageModel.isEmpty()) then
writeLn('Game started!');
if timeWaiting.isFinished() then
begin
writeLn('Took too long to start game, terminating...');
TerminateTheScript();
end
else
exit;
end;
{
Procedure: whereDoWeWalkTo
Description: Decides what side of the game to walk to, favors the south more
you can change the values to whatever you want
Note: if we died, will just wait longer to start walking because of animation
}
procedure whereDoWeWalkTo();
begin
begin
damageModel := ogl.getModels(2263255518);

if damageModel.isEmpty() then
exit;

wait(RandomRange(900, 1100));
case random(60) of
0..30:
begin
wait(randomRange(1000, 1500));
writeLn('Walking to the south');
tileWalk(2, [[0, 18], [0, 10], [0, 10]]);
end;
31..45:
begin
wait(randomRange(1000, 1500));
writeLn('Walking to the west');
tileWalk(2, [[ - 10, 20], [ - 10, 5]]);
end;
46..60:
begin
wait(randomRange(1000, 1500));
writeLn('Walking to the east');
tileWalk(2, [[15, 15], [10, 10]]);
end;
end
end
end;
{
Procedure: weDied
Description: Dang we died, will just call whereDoWeWalkTo
}
procedure weDied();
begin
writeLn('We died.');
repeat
wait(randomRange(600,700));
until ((actionbar.getLifePoints > 0)<>0) or (dialogue.hasDialogue());
if (not dialogue.hasDialogue()) then
whereDoWeWalkTo()
else
exit;
deathCounter := 0;
end;
{
Procedure: attackPest
Description: Clicks on the sent model, checks after clicking to see if we have
a target or not, if we do it waits till we dont, if we dont have one
will just exit
}
procedure attackPest();
var
pestModelArray: glModelArray;
timeAttacking: tCountDown;
pestModel: glModelArray;
begin
case random(100) of
0..50:
begin
pestModel := ogl.getModels(TCardinalArray([1731643360,2782989724,2899052740,3489785670,391528 5997,547053328,617765920])).closestTo(ogl.getClientMidPoint).getVisible();
pestModel[0].toPoint();
mouse.rightClickOption(pestModel[0].adjustPosition(0,-25).randomizePointEllipse(20),['Attack Brawler','Attack Defiler','Attack Shifter','Attack Spinner','Attack Splatter','Attack Torcher']);
end;
51..100:
begin
pestModel := ogl.getModels(TCardinalArray([1731643360,2782989724,2899052740,3489785670,391528 5997,547053328,617765920])).closestTo(ogl.getClientMidPoint).getVisible();
pestModel[0].toPoint();
mouse.click(pestModel[0].adjustPosition(0,-25).randomizePointEllipse(20));
end;
end;

canAttack.setTime(random(1500,1800));
end;
procedure attackPortal();
var
portalModelArray: glModelArray;
timeAttacking: tCountDown;
portalModel: glModelArray;
begin
begin
case random(100) of
0..50:
begin
writeLn('Portal is open, attacking');
portalModel := ogl.getModels(TCardinalArray([2547232634, 1446295722])).closestTo(ogl.getClientMidPoint).getVisible();
portalModel[0].toPoint();
mouse.rightClickOption(portalModel[0].adjustPosition(0,-25).randomizePointEllipse(20),['Attack Portal']);
end;
51..100:
begin
writeLn('Portal is open, attacking');
portalModel := ogl.getModels(TCardinalArray([2547232634, 1446295722])).closestTo(ogl.getClientMidPoint).getVisible();
portalModel[0].toPoint();
mouse.click(portalModel[0].adjustPosition(0,-25).randomizePointEllipse(20));
end;
end;
end;
canAttack.setTime(random(3000,3400));
end;
{
Procedure: useAbilities
Description: Will randomly use one of the abilities that were selected on setup
Checks for cooldowns, etc
}
procedure useAbilities(adrenaline: int32);
begin
wait(randomRange(400, 600));


if (adrenaline >= 100) then
begin
if (actionbar.isAbilityQueued(ULTIMATE)) then
begin
exit;
end;
writeLn('Using ultimate');
sendKeys(LowerCase(actionBar.getAbilityKey(ULTIMAT E)), 10 + normalRandom(0, 20) * 5, 10 + normalRandom(0, 20) * 5);
canUseAbility.setTime(random(6000, 8000));
end;

case random(200) of
0..50:
begin
if (actionbar.isAbilityQueued(THRESHOLD_1)) then
exit;
writeLn('Using threshold number 1');
sendKeys(LowerCase(actionBar.getAbilityKey(THRESHO LD_1)), 10 + normalRandom(0, 20) * 5, 10 + normalRandom(0, 20) * 5);
end;
51..100:
begin
if (actionbar.isAbilityQueued(THRESHOLD_2)) then
exit;
writeLn('Using threshold number 2');
sendKeys(LowerCase(actionBar.getAbilityKey(THRESHO LD_2)), 10 + normalRandom(0, 20) * 5, 10 + normalRandom(0, 20) * 5);
end;
101..150:
begin
if (actionbar.isAbilityQueued(THRESHOLD_3)) then
exit;
writeLn('Using threshold number 3');
sendKeys(LowerCase(actionBar.getAbilityKey(THRESHO LD_3)), 10 + normalRandom(0, 20) * 5, 10 + normalRandom(0, 20) * 5);
end;
151..200:
begin
if (actionbar.isAbilityQueued(THRESHOLD_4)) then
exit;
writeLn('Using threshold number 4');
sendKeys(LowerCase(actionBar.getAbilityKey(THRESHO LD_4)), 10 + normalRandom(0, 20) * 5, 10 + normalRandom(0, 20) * 5);
end;
end;
end;
{
Procedure: insidePestControl
Description: Loop for when inside pest control, will stop looping when it
doesnt find the damage model inside of PC
(the chat box that says we failed, the lady telling us we did good, and the kngiht)
}
procedure insidePestControl();
var
timeSpentInGame, timeWaitingForNewGame: tCountDown;
adrenaline: int32;
begin
timesResetCamera := 0;
whereDoWeWalkTo();
mainScreen.setDegrees(random(0,20),random(10,20));
actionbar.setQuickPrayer(QUICK_PRAYERS);
if (not actionbar.getAutoRetaliate()) then
actionbar.setAutoRetaliate(true);
timeSpentInGame.setTime(random(360000, 420000));
repeat
progressReport();
wait(randomRange(300,700));
allModels := ogl.getModels(TCardinalArray([1731643360,2782989724,2899052740,3489785670,391528 5997,547053328,617765920])).getVisible();
allPortals := ogl.getModels(TCardinalArray([2547232634, 1446295722])).getVisible();
damageModel := ogl.getModels(2263255518);

if (not allPortals.isEmpty()) and (canAttack.isFinished()) then
attackPortal()
else if (combat.hasTarget()) then
begin
writeLn('In combat, waiting...');
repeat
adrenaline := actionbar.getAdrenaline();

if (adrenaline >= 50 <>0) and (canUseAbility.isFinished()) then
begin
useAbilities(adrenaline);
canUseAbility.setTime(random(6000, 8000));
end;
wait(RandomRange(500,600));
allPortals := ogl.getModels(TCardinalArray([2547232634, 1446295722])).getVisible();
damageModel := ogl.getModels(2263255518);
until (not combat.hasTarget()) or (timeSpentInGame.isFinished()) or ((actionbar.getLifePoints <= 0)<>0) or (not allPortals.isEmpty()) or (damageModel.isEmpty());
end
else if (not combat.hasTarget()) then
begin
if (allModels.isEmpty()) and (canRotate.isFinished()) then
begin
writeLn('Rotating to find pest');
rotateCamera();
end
else if (not allModels.isEmpty()) and (canAttack.isFinished()) then
attackPest();
end;

if (actionbar.getLifePoints <= 0) then
weDied();

if (timesRotatedCamera = 5) then
begin
writeLn('Couldnt find pests...walking south a bit to see if we can find anything');
tileWalk(2, [[0, 8]]);
timesRotatedCamera := timesRotatedCamera + 1;
end;

until (timeSpentInGame.isFinished()) or (dialogue.hasDialogue()) or (timesRotatedCamera >= 10);

if (timesRotatedCamera >= 10) then
begin
writeLn('Couldnt find pests after multiple camera rotates, waiting for new game [area most likely clear]');
actionbar.setQuickPrayer(false);
timeWaitingForNewGame.setTime(random(210000,230000 ));
repeat
wait(RandomRange(500,600));
damageModel := ogl.getModels(2263255518);
until (timeWaitingForNewGame.isFinished()) or (damageModel.isEmpty());

if (timeWaitingForNewGame.isFinished()) then
begin
writeLn('Game took too long to start again');
terminateTheScript();
end;
end;

if (timeSpentInGame.isFinished()) then
begin
writeLn('Time in game lasted too long');
terminateTheScript();
end;
end;
{
Procedure: whereAreWe();
Description: Detects where we are based on certain models
will call the appropriate procedure or function
(only runs once)
}
procedure whereAreWe();
begin
wait(randomRange(500, 600));
veteranFlagModel := ogl.getModels(3040129356);
damageModel := ogl.getModels(2263255518);
if (veteranFlagModel.isEmpty()) and (damageModel.isEmpty()) then
begin
writeLn('Were outside starting script');
whereDidWeStart := 1;
end
else if (not veteranFlagModel.isEmpty()) then
begin
writeLn('Were in the boat...starting script');
whereDidWeStart := 2;
end
else if (not damageModel.isEmpty()) then
begin
writeLn('Were inside pestcontrol...starting script');
whereDidWeStart := 3;
end;
end;
{
Procedure: autoUpdateMe();
Description: Checks to see if you have the lastest version of the script
Credit: Fady --> https://villavu.com/forum/member.php?u=152795
}
procedure autoUpdateMe();
var
newFile: integer;
newScript, newFilePath: string;
online_Version: extended;
begin
writeLn('Checking for updates...');
online_Version := strToFloat(getPage('http://static.frement.net/proxy.php?u=https://raw.githubusercontent.com/Introvertt/Adieuxs-Pestcontrol/master/Version.txt'));
writeLn('Local Version ' + toStr(LOCAL_VERSION) + ', Online Version: ' + toStr(online_Version)+'.');

if online_Version > Local_Version then
begin
writeLn('Downloading the latest script version from GitHub');
newScript := getPage('http://static.frement.net/proxy.php?u=https://raw.githubusercontent.com/Introvertt/Adieuxs-Pestcontrol/master/Adieuxs%20Pestcontrol.simba');
newFilePath := scriptPath+ 'Adieuxs Pestcontrol v' + toStr(online_Version) +'.simba';
newFile := rewriteFile(newFilePath, true);

if not writeFileString(newFile, newScript) then
begin
writeLn('Could not write to ' + newFilePath);
terminateTheScript();
end;

closeFile(newFile);
writeLn('Latest script downloaded to ' + newFilePath);
writeLn('Please use the new one to run the latest version!');
terminateScript();
end else
writeLn('Local version is already up to date!');
end;
begin

autoUpdateMe();
ogl.setup(800,600);
GLXViewPort(x,y,x,y);
ogl.setDebugMode(0);
scriptPaintBMP := loadBitmap( AppPath + 'scripts\Adieuxs Pestcontrol\AdieuxsPestcontrolPaint.jpg');
whereAreWe();
repeat

case (whereDidWeStart) of
1: begin
startGame();
areWeInBoat();
waitForGameToStart();
insidePestControl();
whereDidWeStart := 0
end;
2: begin
waitForGameToStart();
insidePestControl();
whereDidWeStart := 0;
end;
3: begin
insidePestControl();
whereDidWeStart := 0;
end;
end;

startGame();
areWeInBoat();
waitForGameToStart();
insidePestControl();

until (gamesPlayed = GAMES_TO_PLAY);

if (gamesPlayed = GAMES_TO_PLAY) then
begin
ClearDebug();
writeLn('We finished playing all our games. Terminating');
TerminateTheScript();
end;

end.


Thanks to Turpinator for aiding me in this process.

EarthAbove
12-18-2015, 10:23 PM
The script compiles but just sits there in front of the plank.

Were outside starting script
Reset camera
Distance from plank 91.9673855233474 walking there now

Thats the only thing that shows whenever I start the script.

chickenfoot911
12-20-2015, 04:42 PM
The script compiles but just sits there in front of the plank.

Were outside starting script
Reset camera
Distance from plank 91.9673855233474 walking there now

Thats the only thing that shows whenever I start the script.

Stop the script, log out and close out of SMART.

START THE SCRIPT again, to get it to open the client. As soon as the client opens, PAUSE the script.
Wait for it to load, log into your account, and go to the square directly next to the starting plank.
Click the camera to face NORTH, then click ENABLE SMART.
Finally, unpause the script, and it should work.

If not, the retry this process again, maybe next time starting in the boat, etc.

Mew
03-09-2016, 01:34 AM
Thank you so much!
It's working now!

Mew
03-09-2016, 08:31 AM
Still not working :(
Error: You are accessing an invalid point, (0,465) at bitmap[0] at line 247
Execution failed.
The following bitmaps were not freed: [0, 1]

Gf Fagex
03-10-2016, 01:53 PM
doesn't work for me :/

onilika
03-10-2016, 06:20 PM
Well, the scripts works really smooth to me. Read the OP and follow the instructions. This script still works.

Trash
03-11-2016, 02:51 AM
Anyone know the fix for the access violation on line 561? I tried installing a new oglib and it didn't work.

Mew
03-14-2016, 10:24 PM
Well, the scripts works really smooth to me. Read the OP and follow the instructions. This script still works.


15:23:52 | Adieuxs PestControl v2.4 > setup
15:23:52 | Adieuxs PestControl v2.4 > debug
15:23:52 | Adieuxs PestControl v2.4 > tSmart.setPair() was successful (PID: 15652)
Were in the boat...starting script
No antiban right now
Waiting for game to start...
Error: You are accessing an invalid point, (0,465) at bitmap[0] at line 247
Execution failed.
The following bitmaps were not freed: [0, 1]

Any fix?

onilika
03-14-2016, 11:58 PM
15:23:52 | Adieuxs PestControl v2.4 > setup
15:23:52 | Adieuxs PestControl v2.4 > debug
15:23:52 | Adieuxs PestControl v2.4 > tSmart.setPair() was successful (PID: 15652)
Were in the boat...starting script
No antiban right now
Waiting for game to start...
Error: You are accessing an invalid point, (0,465) at bitmap[0] at line 247
Execution failed.
The following bitmaps were not freed: [0, 1]

Any fix?

Read the OP closely, run as admin (I always run it like that). If doesn't work, I will team view it

Mew
03-15-2016, 02:37 AM
Anyone know the fix for the access violation on line 561? I tried installing a new oglib and it didn't work.

Same thing here :/

Mew
03-15-2016, 02:38 AM
Read the OP closely, run as admin (I always run it like that). If doesn't work, I will team view it

I always run as admin :o

Piss Lord
05-18-2016, 02:44 PM
Simply can't get this script working. Only works if I start in a game and even then I'll get an error.

trinitrotoluene
05-21-2016, 10:44 PM
Guys go through they have answered every error its working perfectly. i will be almost suicide botting this on double points next weekend.

II_R4MP4G3
05-27-2016, 04:21 AM
did you get this to work with the updated island? it just gets stuck at we're outside no matter where i start the script

jakrz
12-30-2016, 11:19 PM
ha. I think in nowdays biggest problem is to find a worlds where people actually playing this minigame.