ground collect - kaladim constitutionals

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

newbiemq
decaying skeleton
decaying skeleton
Posts: 1
Joined: Thu Apr 08, 2004 9:14 pm

ground collect - kaladim constitutionals

Post by newbiemq » Thu Apr 08, 2004 9:15 pm

use at your own risk .. just figured I'd post it since there wasn't one up here.. it only picks up 7 of each, leaving 3 mushrooms, because why have an uneven number.
here is the code :

#turbo

#include routines.mac

Sub Main
/call DefineGlobals
/if $cursor()!=NULL /click left auto
/if $invpanel==True /press I
/call Mushroom
/return

Sub DefineGlobals
/declare CollectedItem global

/declare LastY global
/declare LastX global
/declare ObstCount global

/declare NotFound global
/return


Sub Mushroom
/Call DoLog "Beginning Collection of Mushrooms"
:Next
/call FindItem *Blue
/call PickUpItem
/call Fungus
/return
|**
new: groundcollect.mac - v1 for kaladim constitutional
original:
GroundCollect.mac - v 1. 0. 1 by FreQuency 10/2/03
Still kinda Incomplete but gonna release as a start for expansion
~ Obstruction Code basis borrowed from Scrime who borrowed from GrimJack
Collects groundspawns from Misty, Butcherblock and Wakening Lands
~Known Issues
* Will not filter spawns considered to be out of reach.
* obstruction code may not get charecter around all areas
*** Many others
Must be monitored to ensure character does not get stuck

**|

Sub Fungus
/Call DoLog "Beginning Collection of Fungus"
:Next
/call FindItem *Red
/call PickUpItem
/call Mushroom
/return

Sub FindItem
:NotFoundReturn
/if n $distance(item)>100 /delay 10s
/varset NotFound 0
/seterror clear
/itemtarget @Param0
/if n $distance(item)>100 /goto :NotFoundReturn
/if "$getlasterror"=="ITEM_NOTFOUND" /call NotFound @Param0
/if "$getlasterror"=="ITEM_NOTFOUND" /varset NotFound $return
/if n @NotFound==1 /goto :NotFoundReturn
/call DoLog "Item found at: $ground(y), $ground(x)."
/return

Sub PickUpItem
/face item
:Nudge
/if n $distance(item)>$rand(2) /press up
/if n $distance(item)>$rand(2) /goto :Nudge
/face item
/mouseto 500 300
/delay 1s
/click left
/delay 1s
/if "$cursor()"=="NULL" /goto :Nudge
/click left auto
/delay 1s
/if $invpanel==True /press I
/press Home
/return

Sub NotFound
/call DoLog "Item: ~~ @Param0 ~~ not found. Waiting 1 min. . ."
/delay 1m
/return 1

Sub DoLog
/mqlog @Param0
/echo @Param0
/return

mekaniak
a hill giant
a hill giant
Posts: 290
Joined: Thu Sep 18, 2003 3:21 pm

Post by mekaniak » Thu Apr 08, 2004 11:02 pm

2 things....was the " it only picks up 7 of each, leaving 3 mushrooms, because why have an uneven number " a wisecrack and ill quote it up for ya....

Code: Select all


#turbo

#include routines.mac

Sub Main
/call DefineGlobals
/if $cursor()!=NULL /click left auto
/if $invpanel==True /press I
/call Mushroom
/return

Sub DefineGlobals
/declare CollectedItem global

/declare LastY global
/declare LastX global
/declare ObstCount global

/declare NotFound global
/return


Sub Mushroom
/Call DoLog "Beginning Collection of Mushrooms"
:Next
/call FindItem *Blue
/call PickUpItem
/call Fungus
/return
|**
new: groundcollect.mac - v1 for kaladim constitutional
original:
GroundCollect.mac - v 1. 0. 1 by FreQuency 10/2/03
Still kinda Incomplete but gonna release as a start for expansion
~ Obstruction Code basis borrowed from Scrime who borrowed from GrimJack
Collects groundspawns from Misty, Butcherblock and Wakening Lands
~Known Issues
* Will not filter spawns considered to be out of reach.
* obstruction code may not get charecter around all areas
*** Many others
Must be monitored to ensure character does not get stuck

**|

Sub Fungus
/Call DoLog "Beginning Collection of Fungus"
:Next
/call FindItem *Red
/call PickUpItem
/call Mushroom
/return

Sub FindItem
:NotFoundReturn
/if n $distance(item)>100 /delay 10s
/varset NotFound 0
/seterror clear
/itemtarget @Param0
/if n $distance(item)>100 /goto :NotFoundReturn
/if "$getlasterror"=="ITEM_NOTFOUND" /call NotFound @Param0
/if "$getlasterror"=="ITEM_NOTFOUND" /varset NotFound $return
/if n @NotFound==1 /goto :NotFoundReturn
/call DoLog "Item found at: $ground(y), $ground(x)."
/return

Sub PickUpItem
/face item
:Nudge
/if n $distance(item)>$rand(2) /press up
/if n $distance(item)>$rand(2) /goto :Nudge
/face item
/mouseto 500 300
/delay 1s
/click left
/delay 1s
/if "$cursor()"=="NULL" /goto :Nudge
/click left auto
/delay 1s
/if $invpanel==True /press I
/press Home
/return

Sub NotFound
/call DoLog "Item: ~~ @Param0 ~~ not found. Waiting 1 min. . ."
/delay 1m
/return 1

Sub DoLog
/mqlog @Param0
/echo @Param0
/return
I love the Power Glove, it's so bad

Say hello to M.C. Smurf!

[quote]<mekaniak> adios guys.
<dont_know_at_all> idiot
* mekaniak is now known as mekaniak_dinner
<Jacensolo> me?
<dont_know_at_all> not this time
[/quote]

[quote]
<dont_know_at_all> A_Enchanter_00, how the fuck should i know? it's your code[/quote]

I love quoting IRC chat.

Ahroun
orc pawn
orc pawn
Posts: 10
Joined: Wed Feb 18, 2004 10:56 pm

Post by Ahroun » Tue Apr 13, 2004 4:38 am

Ok this was very overly complex. thanks to some help in irc on a couple things i made some changes. It works much better now.

Code: Select all

#turbo 

#include routines.mac 

sub Main 
/call DefineGlobals 
/if $cursor()!=NULL /click left auto 
/if $invpanel==True /press I 
/call Mushroom 
/return 

sub DefineGlobals 
/declare CollectedItem global 

/declare LastY global 
/declare LastX global 
/declare ObstCount global 

/declare NotFound global 
/return 


sub Mushroom 
/call DoLog "Beginning Collection of Mushrooms" 
:Next 
/call FindItem *Blue 
/call PickUpItem 
/call Fungus 
/return 

sub Fungus 
/call DoLog "Beginning Collection of Fungus" 
:Next 
/call FindItem *Red 
/call PickUpItem 
/call Mushroom 
/return 

sub FindItem 
:NotFoundReturn 
/if n $distance(item)>100 /delay 10s 
/varset NotFound 0 
/seterror clear 
/itemtarget @Param0 
/if n $distance(item)>100 /goto :NotFoundReturn 
/if "$getlasterror"=="ITEM_NOTFOUND" /call NotFound @Param0 
/if "$getlasterror"=="ITEM_NOTFOUND" /varset NotFound $return 
/if n @NotFound==1 /goto :NotFoundReturn 
/call DoLog "Item found at: $ground(y), $ground(x)." 
/return 

Sub MoveToTarget 
:KeepMoving 
   /face loc $ground(y), $ground(x) 
   /sendkey down up 
      /if n $distance(item)>9 /goto :KeepMoving 
:StopMoving 
   /sendkey up up 
/return 

sub PickUpItem 
/face item 
/call MoveToTarget
/click left item
/delay 1s 
/autoinv 
/press Home 
/return 

sub NotFound 
/call DoLog "Item: ~~ @Param0 ~~ not found. Waiting 1 min. . ." 
/delay 1m 
/return 

sub DoLog 
/mqlog @Param0 
/echo @Param0 
/return

Lane
a hill giant
a hill giant
Posts: 201
Joined: Fri Dec 06, 2002 11:57 am

Post by Lane » Tue Apr 13, 2004 6:24 pm

.was the " it only picks up 7 of each, leaving 3 mushrooms, because why have an uneven number " a wisecrack
This is funny, but he is refering to the fact that there are more mushrooms than fungus, so to have an "even" number between them you would need to leave 3 mushrooms behind.

So, even refers to the difference between the two items you wil collect, and not being divisable by 2.

-Lane