EvenLessSpam
Active member
- Joined
- Oct 31, 2005
- RedCents
- 91¢
I created this plugin to "smarter" ganking of ground items. As can be seen it's especially usefull for Kaladim Shrooms and Bow Staffs in Elddar Forest.
Enjoy, and feel free to throw RED CENTS my way if you like it
Please note that Ganking will be very obvious to people looking at you. You'll make small (instant) turns on the spot when ganking. Just a friendly warning, so I'd recommend using the PlayerWatch feature
Seems I made an ugly typo in the title, could some kind mod change it in the overview as well?
Enjoy, and feel free to throw RED CENTS my way if you like it

Please note that Ganking will be very obvious to people looking at you. You'll make small (instant) turns on the spot when ganking. Just a friendly warning, so I'd recommend using the PlayerWatch feature

Seems I made an ugly typo in the title, could some kind mod change it in the overview as well?

Rich (BB code):
| sgank.mac -- Smart Ganking by ELS (EvenLessSpam)
#Event ItemTargeted "Item '#1#' targeted."
#Event NoItem "Couldn't find '#1#' to target."
#Event NoRoom "There was no place to put that! The item has dropped to the ground!"
#Event MQ2Cursor "MQ2Cursor::REQUIRE Instruction <#1#>#*#"
Sub Main
/if (!${Plugin[MQ2CGank].Name.Equal[MQ2CGank]}) /plugin MQ2CGank noauto
/if (!${Plugin[MQ2CGank].Name.Equal[MQ2CGank]}) {
/echo [${Time.Time24}] Required plugin 'MQ2CGank' could not be loaded..
/endmacro
}
/declare i int local 0
/declare Timeout timer outer 10s
/declare Interval string outer 1m
/declare gDelay string outer 2s
/declare PWRadius int outer 500
/declare ZoneCheck int outer ${Zone.ID}
|--------------------------------------------------------------------------|
|-------- Begin Zone Specifik Setup - Should be self-explanatory --------|
|--------------------------------------------------------------------------|
/if (${Zone.Name.Equal[North Kaladim]}) {
/declare gItem[2] string outer NULL
/varset gItem[1] *Red Mushroom0
/varset gItem[2] *Blue Mushroom0
/declare Roam[2] string outer NULL
/varset Roam[1] 645.92 -144.03 5
/varset Roam[2] 665.86 -90.55 5
/declare RoamTimer timer outer 3m
/declare RoamPoint int outer 1
/varset Interval 3m
/varset PWRadius 200
} else /if (${Zone.Name.Equal[The Elddar Forest]}) {
/declare gItem[1] string outer NULL
/varset gItem[1] 2H Staff
/varset Interval 10m
/varset PWRadius 500
}
|--------------------------------------------------------------------------|
|----------------------- End Zone Specifik Setup ------------------------|
|--------------------------------------------------------------------------|
/if (${Defined[gItem]}) {
/for i 1 to ${gItem.Size}
/declare mItem${i} timer outer 0
/next i
}
:loop
/if (${Zone.ID} != ${ZoneCheck}) {
/echo Zone changed. Ending macro.
/endmacro
}
/call SafetyCheck
/if (${Defined[Roam]} && !${RoamTimer}) {
/varset RoamTimer ${RoamTimer.OriginalValue}
/if (${RoamPoint} == 1) {
/varset RoamPoint 2
} else {
/varset RoamPoint 1
}
/call MoveToLoc ${Roam[${RoamPoint}]}
}
/if (!${Defined[gItem]}) {
/itemtarget
/doevents
/delay ${gDelay}
} else {
/for i 1 to ${gItem.Size}
/if (!${mItem${i}}) /itemtarget ${gItem[${i}]}
/doevents
/delay ${gDelay}
/next i
}
/if (!${Timeout} && !${Defined[gItem]}) /call NoItem
/goto :loop
/return
Sub SafetyCheck
/if (${SpawnCount[gm]} || ${SpawnCount[pc radius ${PWRadius} notid ${Me.ID}]}) {
/if (${Me.Moving}) {
/keypress FORWARD
/keypress BACK
}
/beep
/beep
/beep
/echo [${Time.Time24}] !!! Alert !!!
/echo [${Time.Time24}] Macro paused...
/if (!${Me.AFK}) /afk
:loop
/delay 10s (!${SpawnCount[gm]} && !${SpawnCount[pc radius ${PWRadius} notid ${Me.ID}]})
/if (${SpawnCount[gm]} || ${SpawnCount[pc radius ${PWRadius} notid ${Me.ID}]}) /goto :loop
/echo [${Time.Time24}] Macro resumed...
}
/return
Sub NoItem
/if (${Defined[Param0]}) {
/echo [${Time.Time24}] Couldn't find any '${Param0}'. Waiting ${Interval} before resuming search.
} else {
/echo [${Time.Time24}] Couldn't find any items. Waiting ${Interval} before resuming search.
/declare Wait timer local ${Interval}
:loop
/doevents
/if (!${Wait}) /goto :end
/goto :loop
:end
/varset Timeout ${Timeout.OriginalValue}
}
/return
Sub MoveToLoc(float Y, float X, float MaxDist)
/declare LastDistance int local ${Target.ID}
/varset LastDistance ${Math.Distance[${Y}, ${X}]}
/if (!${Me.Standing}) /stand
/face fast nolook loc ${Y},${X}
/delay 1s
/keypress FORWARD
/keypress FORWARD hold
:loop
/call SafetyCheck
/doevents
/face nolook loc ${Y},${X}
/if (${Math.Distance[${Y}, ${X}]} > ${LastDistance}) {
/keypress FORWARD
/keypress BACK
/delay 1s
/face fast nolook loc ${Y},${X}
/delay 1s
/keypress FORWARD
/keypress FORWARD hold
}
/varset LastDistance ${Math.Distance[${Y}, ${X}]}
/if (${Math.Distance[${Y}, ${X}]} > ${MaxDist}) {
/delay 1
/goto :loop
}
/keypress FORWARD
/keypress BACK
/return
Sub Event_ItemTargeted
/varset Timeout ${Timeout.OriginalValue}
:cursor
/if (${Cursor.ID}) /autoinventory
/if (${Cursor.ID}) /goto :cursor
/gank
/return
Sub Event_NoRoom
/echo [${Time.Time24}] No more inventory space. Executing /quit in 60 seconds..
/declare QuitTimer timer local 1m
:loop
/echo [${Time.Time24}] Executing /quit in ${Math.Calc[${QuitTimer}/10].Int} seconds; /endmacro to abort..
/popup Executing /quit in ${Math.Calc[${QuitTimer}/10].Int} seconds; /endmacro to abort..
/delay 1s
/if (${QuitTimer}) /goto :loop
/echo [${Time.Time24}] Executing /quit NOW!
/popup Executing /quit NOW!
/endmacro
/quit
/return
Sub Event_NoItem(string Line, string NoItem)
/declare i int local 0
/for i 1 to ${gItem.Size}
/if (${gItem[${i}].Equal[${NoItem}]}) /varset mItem${i} ${Interval}
/next i
/call NoItem "${NoItem}"
/return
Sub Event_MQ2Cursor
/autoinventory
/return
Last edited:

