• Hail, we're RedGuides. We want you to play six (yes, 6!) EverQuest characters at once. We have scripts and a friendly community to help, please join our playstyle and say hello! 👋
  • We've added LLM sections to our Terms & Rules and Resource Rules, for everyone's sanity & in-game safety.
    Read more
    a. Do not replace your voice with an LLM. This goes for your posts and your scripts. Drafting and editing with a tool is fine, but don't take you out of what you share.
    b. Do not replace your EQ character's voice with an LLM. We don't want scripts that speak over /ooc, /shout or other public channels. This has been an unwritten rule that's kept casino scripts off the site for decades, but we're now compelled to make it clear: keep automated communication private.

    Why Does RG Review Scripts?
    Nearly every LLM-written Lua script we see is making your character do impossible things, and rarely in a way that's beneficial to you. We've seen heavy server hammering, /target over impossible distances when /nav spawn would passively accomplish the same thing, a spawn search that fires 20+ times per second, and other pointless actions that are likely annoying GMs.

    You are welcome to use LLMs as a tool to structure, draft, and edit your work, but please read critically before hitting /lua run

sgank.mac - Smart Ganking

EvenLessSpam

Active member
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? :)

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:
()===D====> said:
Why not use the slower "/face"?
You're thinking of the auto roaming part? That part was added for 2 reasons.

1. To try avoiding getting kicked from server by having too much idle time (ot for some reason happens sometimes, not found a reason for it)
2. To make it "less" obvious to people coming by from time to time. They'll see you actually move around once in a while and will hopefully then think that you're there but just AFK right now.

The thing I talked about where you take small instant turns on the spot, is not this macro cauing it but MQ2CGank itself. You don't see it on the screen running MQ2CGank, but try looking from another toon and you'll see it instantly when the ganking occurs.

As to the /face instead of /face fast for the auto-roamer, I don't think it makes much of a difference if you're being watched anyway. It's kinda suspicious walking back and forth on the same path constantly ;)
 
OOO man how about sgank AND yafm? Now that would extra ROCK!!!
Actually i have a GANK button that while running yafm it will destory anything not in my forage.ini so i just rach over and hit it a few times here and there...
 
FJRinFL said:
OOO man how about sgank AND yafm? Now that would extra ROCK!!!
Actually i have a GANK button that while running yafm it will destory anything not in my forage.ini so i just rach over and hit it a few times here and there...
I use MQ2Cursor to handle that part, both for forages and ganks.
 
sgank.mac - Smart Ganking

Users who are viewing this thread

Back
Top
Cart