• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Change the look. To dismiss this notice, click the X --->
  • Unfortunately, yes, there is a suspension wave happening around the new tlp launch. :'( Please keep regular discussion to Suspension MegaThread and please consider submitting a Suspension report to RG.

Code Assistance Request - please (1 Viewer)

Cpt_Cam

Member
Joined
Jul 30, 2005
RedCents
Ok..I'm tired of the "BBB please" request...I cna't lean back in my chair and play guitar..so that's annoying

does anybody have a code example laying around that is essentially a chat tell event that parses around defined text..

I want it to look at incoming text and regardless of what is said, if BBB or bbb is in the statement I want to target $sender and cast bbb on them.
 
There are actually some macs out there allready set up to handle this. BBB is a Pally spell if I remember correctly. I think there may be a couple afkpally macros either here or in the macroquest forums. I will look around in here. I can't look macroquest from work cause its filtered out.
 
Easy way is just to make an event..

Rich (BB code):
#Event BBBplz "#1# tells you, '#*#BBB#*#'"

Sub Event_BBBplz(string whiner)
/tar ${whiner}
/delay 1s
/cast 1
/return

Just mem BBB in slot 1..you can also make other events for stuff you want using the bbb example above. I'm pretty new to macros, but I think this would work =P
 
Rich (BB code):
#Event BBBplz "#1# tells you, '#*#BBB#*#'"
#Event BBBplz "#1# tells you, '#*#bbb#*#'"
#Event BBBplz "#1# tells you, '#*#Brells#*#'"
#Event BBBplz "#1# tells you, '#*#Buff#*#'"

:loop
/doevents
/delay 1s
/goto :loop

Sub Event_BBBplz(string whiner)
/tar ${whiner}
/delay 1s
/cast 1
/return

This will work as well to kinda catch the folks that don't hit ya with BBB exactly in your tell. Nice work liestol, I was gonna get a code posted here after researched it a bit, you beat me to it.
 
Last edited:
Every macro has to have a "sub main". The macroquest.exe knows to start every macro with the sub main function, it's a part of the standard C/C++ protocols.


Rich (BB code):
#Event BBBplz "#1# tells you, '#*#BBB#*#'"
#Event BBBplz "#1# tells you, '#*#bbb#*#'"
#Event BBBplz "#1# tells you, '#*#Brells#*#'"
#Event BBBplz "#1# tells you, '#*#Buff#*#'"

sub main
:loop
      /doevents
      /delay 5
      /goto :loop
/return

Sub Event_BBBplz(string whiner)
/tar ${whiner}
/delay 1s
/cast 1
/return
 
LOTSA REM STATEMENTS FOR LEARNING
Rich (BB code):
#Event BBBplz "#0# tells you, '#*#BBB#*#'"
#Event BBBplz "#0# tells you, '#*#bbb#*#'"
#Event BBBplz "#0# tells you, '#*#Brells#*#'"
#Event BBBplz "#0# tells you, '#*#Buff#*#'"

|~~This is your main loop to check and see if any of your events have occured yet~~|
Sub Main
:startloop
/doevents
/delay 1
/goto :startloop
/end

|~~If an even occurs which you have named BBBplz then it will preform this next set of command and adds the persons name as whiner~| 
Sub Event_BBBplz(string whiner)
/delay 1s
|~If whiner is not in zone or not within 50 feet start over~~|
/if (!${Spawn[pc ${whiner}].ID} || ${Spawn[pc ${whiner}].Distance3D}>50) /return
|~~Attempt to target whiner~~|
/tar pc ${whiner}
|~~ wait one second or until you have aquired your target whiner~~|
/delay 1s ${Target.CleanName.Equal[${whiner}]}
/cast 1
/delay 5s
/return

Ok this was actually made by z166204 who helped me when I asked the questions trying to make that for you. As you can see mine was not complete and this is very advanced. I have broke it down to the best of my ability so others can learn from it as I did. Make sure to Send HIM a red cent for this and not me. :D

WITHOUT ALL THE REM STATEMENTS
Rich (BB code):
#Event BBBplz "#0# tells you, '#*#BBB#*#'"
#Event BBBplz "#0# tells you, '#*#bbb#*#'"
#Event BBBplz "#0# tells you, '#*#Brells#*#'"
#Event BBBplz "#0# tells you, '#*#Buff#*#'"

Sub Main
:startloop
/doevents
/delay 1
/goto :startloop
/end

Sub Event_BBBplz(string whiner)
/delay 1s
/if (!${Spawn[pc ${whiner}].ID} || ${Spawn[pc ${whiner}].Distance3D}>50) /return
/tar pc ${whiner}
/delay 1s ${Target.CleanName.Equal[${whiner}]}
/cast 1
/delay 5s
/return
 
Minor addition to maybe help out anybody else ..modularized the buff piece and put in a quick reply..

Thanks for the help on this one. Now ican play guitar.



#Event BBBplz "#0# tells you, '#*#BBB#*#'"
#Event BBBplz "#0# tells you, '#*#bbb#*#'"
#Event BBBplz "#0# tells you, '#*#Brells#*#'"
#Event BBBplz "#0# tells you, '#*#Buff#*#'"
#include spell_routines.inc

|~~This is your main loop to check and see if any of your events have occured yet~~|
Sub Main
/declare Buff1 string outer "Brell's Brawny Bulwark"
:startloop
/doevents
/delay 1
/goto :startloop
/end

|~~If an even occurs which you have named BBBplz then it will preform this next set of command and adds the persons name as

whiner~|
Sub Event_BBBplz(string whiner)
/delay 1s
|~If whiner is not in zone or not within 50 feet start over~~|
/if (!${Spawn[pc ${whiner}].ID} || ${Spawn[pc ${whiner}].Distance3D}>50) /return
|~~Attempt to target whiner~~|
/tar pc ${whiner}
|~~ wait one second or until you have aquired your target whiner~~|
/delay 1s ${Target.CleanName.Equal[${whiner}]}
| -- /tell ${whiner} kk
/call cast ${Buff1}
/delay 5s
/return
 
This brings up an interesting thing to me...

You can break things down by their attributes I
guess...

for example

${Spawn[pc ${whiner}].Distance3D}>50

This is saying "pc with name represented by the variable whiner greater than 50 units away.."

is there a definitions list of all this breakdown somewhere I can go look and see what variables or attributes I can play with?

I'm thinking of other ideas now..such as..

"check the distance of pc named anything within a 200 distance and if their health is lower than X..then cast Light of Piety..etc..If I wrote that out it would look something like

:loop

/target ${Spawn[pc].distance3d}<200
/if (${Spawn[pc].PctHPs}<60
{
/call cast ${healspell} | defined in some declare earlier
/delay 5s
}
/tar pc next | unsure where I'd stick that without testing
/goto :loop
 
This idea has merit, but one flaw is mq does not continually update ALL units around you for all values (such as health). Health specifically only gets updated if the spawn in question is in your group, is a group members pet, is targeted by your assigned group assist, is targeted by your assigned raid assist, is your target, or is the current target of your target (if you have the aa in group/raid).

Also to put this into use you would need to make a loop to do the health check on each spawn in range to force the update. Like below:

Rich (BB code):
/declare spawnloop int local
/for spawnloop 1 to ${SpawnCount[pc radius 200]}
  /if (${NearestSpawn[${spawnloop}, pc].PctHPs}<60}) {
    /do some stuff
  }
/next spawnloop

If you wanted to forcefully update all the spawns around you, you would need to make a loop to /target each one. (This can be annoying if your activly playing the character as well as looks very suspecious is someone else is looking at what you are targeting.) Here is a sample I have in a custom macro that scans for npcs near me to update their health:

Rich (BB code):
Sub checknearestspawns
	/declare closestspawns int local ${SpawnCount[npc radius 100]}
	/if (!${closestspawns}) /return
	/declare npccheck int local 0
	/declare oldtarget int local ${Target.ID}
	/for npccheck 1 to ${closestspawns}
		/if (${NearestSpawn[${npccheck},npc].LineOfSight}) /target ID ${NearestSpawn[${npccheck},npc].ID}
		/delay 1
	/next npccheck
	/target ID ${oldtarget}
/return

I hope these samples assist with your ideas you might want to put into play.
 
Cpt_Cam said:
Minor addition to maybe help out anybody else ..modularized the buff piece and put in a quick reply..

Thanks for the help on this one. Now ican play guitar.



INI:
#Event BBBplz "#0# tells you, '#*#BBB#*#'"
#Event BBBplz "#0# tells you, '#*#bbb#*#'"
#Event BBBplz "#0# tells you, '#*#Brells#*#'"
#Event BBBplz "#0# tells you, '#*#Buff#*#'"
#include spell_routines.inc

|~~This is your main loop to check and see if any of your events have occured yet~~|
Sub Main
/declare Buff1 string outer "Brell's Brawny Bulwark"
:startloop
/doevents
/delay 1
/goto :startloop
/end

|~~If an even occurs which you have named BBBplz then it will preform this next set of command and adds the persons name as whiner~| 
Sub Event_BBBplz(string whiner)
/delay 1s
|~If whiner is not in zone or not within 50 feet start over~~|
/if (!${Spawn[pc ${whiner}].ID} || ${Spawn[pc ${whiner}].Distance3D}>50) /return
|~~Attempt to target whiner~~|
/tar pc ${whiner}
|~~ wait one second or until you have aquired your target whiner~~|
/delay 1s ${Target.CleanName.Equal[${whiner}]}
| -- /tell ${whiner} kk
/call cast ${Buff1}
/delay 5s
/return


This is shown as Code by either puting [ C O D E ] at the begining (no spaces) and then [/code] at the end of your code, makes it a little easier on cut and past as sometimes it will cause extra return values or spaces.
 
Code Assistance Request - please

Users who are viewing this thread

Back
Top