Enchanter CharmNTash.mac

link762698

New member
Joined
Mar 2, 2009
Messages
8
Reaction score
0
Points
0
v0.10
ok im sorry i got your hopes up at the moment i am working on it, matter of fact i just started it and now i gotta go to work, ive actually learned an extreme amount about scripting over night, was lots of reading and reading. can look it over see if ive done anything wrong. Basically what this script is going to do for me is, keep a pet charmed, keep buffs up and assist the main assist and debuff the mob, with options of assist mezng, nuking the mob. and other features i havent thought about yet feel free to post and ill see if its worth putting in there.

P.S. my very first time doing this with mq2 be easy on me

Code:
|Credits go to makers of shambot for the 3 subroutines, and i used their mac to start work on my own, thanks maskoi and others.
|

|++Events


#include Spell_Routines.inc
#include ninjadvloot.inc

|Do Not Edit it in here please unless you know what you are doing.
|Thanks, ensures its not my errors that way

Sub Main
	/if (${Me.Class.ShortName.NotEqual[ENC]}) {
		/echo Did you think you could FOOL ME WITH YOUR SILLY DISGUISE.
		/echo I PITY THE FOOL!
		/echo P.S. Go make a enchanter so you can test this out.
		/endmacro
	}

	/declare IniFileName 			string 	outer 	CharmNTash${Me.Name}.ini
	/declare CharmNTashVer				string	outer	0.10

	/call CreateIni

	/call LoadIni Spell Help		string		"Put spell name for each like CharmName=Beguile, and CharmGem=1 if its in your first spell gem."
	/call LoadIni Spell CharmName		string		Beguile
	/call LoadIni Spell CharmGem		int		2
	/call LoadIni Spell DebuffName		string		Choke
	/call LoadIni Spell DebuffGem		int		1
	/call LoadIni Spell RuneName		string		Rune II
	/call LoadIni Spell RuneGem		int		3
	/call LoadIni Spell TashName		string		Tashani
	/call LoadIni Spell TashGem		int		4
	/call LoadIni Spell MezName		string		Enthrall
	/call LoadIni Spell MezGem		int		5
	/call LoadIni Spell SlowName		string		Languid Pace
	/call LoadIni Spell SlowGem		int		6
	/call LoadIni Spell StunName		string		Chaos Flux
	/call LoadIni Spell StunGem		int		7
	/call LoadIni Spell BuffGem		int		8
	/call LoadIni Spell MRegenName		string		Breeze
	/call LoadIni Spell HasteName		string		Alacrity
	/call LoadIni Spell InvisName		string		Invisibility
	/call LoadIni Spell ChaBuffName		string		Sympathetic Aura
	/call LoadIni Spell AcBuffName		string		Cloud
	/call LoadIni Spell Gate		string		Gate
	/call LoadIni Spell Masterhelp		string		"This would be a Master Controller, like the main box toon, you can send tells for it to mez adds"
	/call LoadIni Spell Masterhelper	string		"or buff your target, to buff yourself target yourself, or leave it alone if dont wish to use"
	/call LoadIni Spell Master		string		YourMainNameHere

	/call LoadIni Setup MainAssistName	string		YourMainAssistsNameHere
	/call LoadIni Setup Help		string		"in here, its just 1 and 0, 1 meaning yes do it, 0 meaning dont do it."
	/call LoadIni Setup DoSlow		int		1
	/call LoadIni Setup UseMaster		int		1
	/call LoadIni Setup UseCharmPet		int		1
	/call LoadIni Setup UseDebuff		int		1
	/call LoadIni Setup CastWhileInvis	int		0
	/call LoadIni Setup UseRune		int		1
	/call LoadIni Setup UseTash		int		1
	/call LoadIni Setup KeepBuffsUp		int		1
	/call LoadIni Setup UseStun		int		0
	/call LoadIni Setup UseAcBuff		int		0
	/call LoadIni Setup DoLoot		int 		1
	/call LoadIni Setup helper		string		"CampRadius is how far to leash for loot"
	/call LoadIni Setup CampRadius		int		30
	/declare AutoFollow	int 	outer		0 
	/declare SitAt	int	outer	90

:Main_Loop
	/doevents
	| -- Nothing to see here hurry up and finish. 

	| - Not in game end macro
	/if (${MacroQuest.GameState.Equal[CHARSELECT]}) /end
	
	| - Am I dead
	/if (${AcceptRez} && ${Window[RespawnWnd].Open}) /call Accept_rez	
	
	| - Auto Follow
	/if (${AutoFollow}) /call AutoFollow
	
	| - Do we move?
	:Hold_Main
	/if (${Me.Moving}) /goto :Hold_Main
	
	| - Check for Standing if less than sitat then sit
	/if (!${Me.Sitting} && ${Me.PctMana}<${SitAt} && !${Engaged}) /sit
	
	| - If in CombatOn don't buff
	/if (!${CombatOn} && ${Me.XTarget} == 0 || ${BuffInCombat}) {
	
	| - Loot mobs
	/if (!${CombatOn} && ${DoLoot} && !${Me.Moving}) /call LootMobs
	
	| - Loot mobs
	/if (${DoCamp}) /call MoveToCamp
	
	/call CheckRoles
	
	/goto :Main_Loop
	
/return

Sub CheckRoles
	/declare i int local 
  	/for i 1 to ${Group.Members}
	/if (${Group.Member[${i}].Puller} && ${Group.Member[${i}].CleanName.NotEqual[${M_Assist}]} && !${PullPC}) { 
		/varset PullPC ${Group.Member[${i}].ID}
		/echo  +++ Puller role found! Puller set to >> ${Group.Member[${i}]} <<. +++
	}

	/if (!${SAAsigned} && ${SecondAssist.NotEqual[NULL]} && ${Spawn[${SecondAssist}].ID} && (!${Spawn[${M_Assist}].ID} || ${Spawn[${M_Assist}].Type.Equal[Corpse]}) || ${Spawn[${M_Assist}].Hovering}) {
		/echo +++ Tank's gone switching to Secondary Assist >> ${SecondAssist} << +++	
		/varset MADead	${M_Assist}
		/varset SAAsigned 1
		/varset M_Assist ${SecondAssist}
		/varset M_Assist_type ${Spawn[${SecondAssist}].Type}
		/varset TempHPID 0
		/varset DefProcID 0
	}
	/if (!${Engaged} && ${SAAsigned} && (${Spawn[${MADead}].ID} && !${Spawn[${MADead	}].Hovering})) {
		/if (!${Spawn[${MADead}].ID} && !${Spawn[${SecondAssist}].ID}) /return
		/echo +++ Tank's back dropping ${SecondAssist} for >> ${MADead} << +++	
		/varset SAAsigned 0
		/varset M_Assist ${MADead}
		/varset M_Assist_type ${Spawn[${MADead}].Type}
	}
	/next i
/return

Sub CreateIni
	/if (${Ini[${IniFileName}].Length}) /return
	/declare a 	local Spells|
	/echo Creating ini file ${IniFileName}
	/declare i int local 1
	/for i 1 to 3
		/ini ${IniFileName} "${a.Arg[${i},|]}" "|===================================" "==================================|"
	/next i
	/echo Please edit your ini file ${IniFileName} and restart CharmNTash
|	/endmacro
/return

Sub LoadIni(string sectionName, string varName, string varType, string varValue, string varArray)
	/if (${${varArray}.Size}>0) {
		/declare i int local
			/for i 1 to ${${varArray}.Size}
				/if (!${Ini[${IniFileName},${sectionName},${varArray}${i}].Length}) /ini "${IniFileName}" "${sectionName}" "${varArray}${i}" "${varValue}"
				/if (${Ini[${IniFileName},${sectionName},${varArray}${i}].Length}) /varset ${varArray}[${i}]  ${Ini[${IniFileName},${sectionName},${varArray}${i}]}
			/next i
		/return
	} else {
		/if (!${Defined[${varName}]} && ${Defined[varType]}) /declare ${varName} ${varType} outer
		/if (!${Ini[${IniFileName},${sectionName},${varName}].Length}) {
			/if (${varValue.Length}) {
				/ini "${IniFileName}" "${sectionName}" "${varName}" "${varValue}"
				/varset ${varName} ${varValue}
			}
		} else {
			/varset ${varName} ${Ini[${IniFileName},${sectionName},${varName}]} 
		}
	}
/return
 
Last edited: