Sorceress's Garden
Progress Report:[------------------------------------------------] [ ] [ Putonajonny's Sorceress's Garden Runner ] [ Version: 1 ] [------------------------------------------------] [ Time Running: 30 Minutes and 33 Seconds ] [ Courses Completed: 28 ] [ Courses/Hour: 54 ] [ Success %: 100.0 ] [------------------------------------------------]
Enjoy :)
Post any problems you have, winter garden only (my members ran out).
Simba Code:Strings[0] := Garden_Winter; //Which garden
(*Choose the garden here:
- Garden_Winter
- Garden_Spring
- Garden_Autum
- Garden_Summer*)Simba Code:Strings[1] := Reward_Fruit; //Reward_Fruit or Reward_Herbs
(*Choose whether to pick fruit or herbs
- Reward_Fruit
- Reward_Herbs*)Simba Code:Strings[2] := Glasses_Collect;
(*
- Glasses_Withdraw - Withdraws beer glasses from your bank
- Glasses_Collect - Collects glasses from the spawn spot (recommended)
- Glasses_None - just banks the fruit
If you are using herbs ignore this option *)
If you haven't already you need to download the Object DTM include
How to update this for another garden:
First of all I recommend you go to line 31 and remove the two // at the start of the line, then watch it on the winter garden several times over to understand how it works.
- WalkToStart - You need to add a section to this function to walk to the gate of your chosen garden, shouldn't be very difficult.
- OpenGate - You need to add a section to this function for walking to your chosen garden.
- GotCaught - You need to add a section to this function that determines whether you are back in the middle of the gardens (based on minimap colours or something)
- WaitForColorsInBoxes - This is the function used to determine when we can walk, I'll explain how it walks:
This function analyses the minimap, say this is you:Simba Code:Function WaitForColorsInBoxes(Colour : integer; Boxes : array of array of TBox; Tol : integer; TimeOut : integer) : Boolean;
http://i.imgur.com/i38MQ.png
It waits until there is at least one pixel of yellow inside each of the different colours of boxes, so currently it wouldn't return true because neither the blue or the purple boxes have yellow in them, however the brown does, only once at least one of each colour box has yellow in it, once it got to this:
http://i.imgur.com/SA99C.png
it would return true and you could walk.
I'll now explain the parameters:
Colour - The yellow colour of the minimap dot
Boxes - A 2d array of the boxes, in the above example Boxes[0] is the blue boxes Boxes[1] is the purple boxes and Boxes[2] are the purple ones. Boxes[0][0] is the vertical blue box, Boxes[0][1] is the horizontal one. This is how the boxes are defined:
This is how you set them, should be fairly self explanatory.Simba Code:SetArrayLength(B, 2);
B[0] := [IntToBox(x - 10, y, x + 10, y + 4), IntToBox(x + 3, y - 10, x + 8, y)];
B[1] := [IntToBox(x - 12, y + 9, x - 3, y + 32)];
WaitForColorsInBoxes(62714, B, 30, 0);
Tolerance - The tolerance for finding the yellow colour, 30 seems to never fail.
Timeout - This is a wait function, so it does not just test once then give the result, this is how long you want it to keep trying for, if you set it to 0 it will never timeout.- You now need to create a procedure called SpringGarden or whatever garden you are doing.
- In this you are going to need to call the WalkToStart procedure, then the OpenGate one (with failsafes).
- Then you are going to need to use some method to determine where to put your boxes (if you know exactly where you are you can use static co-ordinates which work well)
- You need to move your mouse to the point you want to click.
- You need to run the WaitForColorsInBoxes function, once that is done you need to click.
- You need to keep doing this until you get to the end of the maze.
- Now depending on whether you are collecting fruit or herbs you need to add that to the end of this procedure (Or Both).
- At every step during that procedure you need to have:
That way if you get caught it won't keep trying to get through the maze, it will start again.Simba Code:if(GotCaught)then
begin
inc(Failures)
exit;
end;- At the end of it, once you have collected the fruit or the herbs you need to:
Simba Code:inc(Successes);- In the FindFruit Procedure you need to add a DTM of the fruit for your garden.
- Finally, go to the end of the script where it says:
You need to add your garden in here, like:Simba Code:Case Players[CurrentPlayer].Strings[0] of
Garden_Winter : WinterGarden(0);
else
begin
WriteLn('Sorry '+Players[CurrentPlayer].Strings[0]+' garden isn'+#39+'t supported yet');
exit;
end;
Simba Code:Case Players[CurrentPlayer].Strings[0] of
Garden_Winter : WinterGarden(0);
Garden_MyNewGarden : MyNewGarden();
else
begin
WriteLn('Sorry '+Players[CurrentPlayer].Strings[0]+' garden isn'+#39+'t supported yet');
exit;
end;
That's it, you are done! have fun with it, please post any problems, and please post what you made, I have gone to the effort of making a lot of this script and made it available for at least me, if not then everybody else here :)

