I set it up to Stun any mob I am in combat with, once, when I am first in combat, and then randomly until it dies. The only current problem is Personal.Inc is run through so fast, the random is always true by the time the stun is back up (steady stuns) .. all good.
Code: Select all
|personal.inc
|Personal commands module example.
|Version 12.00
|Date:04/24/2004 11:00 pm
|
||**
[personal]
version=12.00
**||
|Define your personal Events Here
|#Event EExample "Explain it to me again"
Sub PersonalCommands
|For each command
|1,x Command Phrase to trigger bot - End User change change to suit prefferences
|2,x Sub Routine to execute in response to command
|/varset BotPersonalsarray (1,0) StunOn
|/varset BotPersonalsarray (2,0) /call StunOn
/varset ArrayPers 0
/return
Sub SetupPersonalVars
| Variable to = 1 before combat, and 0 when combat is complete
/declare FirstStun global
/varset FirstStun 1
|Declare you variables here and Set their Defaults
|/declare PersonalValue global
|/Declare AnotherValue global
|INI Values
|/varset PersonalValue "${Ini[@IniFile,Personal,PersonalValue,NotFound)"
|/if (${String[@PersonalValue].Equal[NOTFOUND]}) {
| /ini "@IniFile" Personal PersonalValue "Example Value"
| /varset PersonalValue "Default Value"
|}
||||||||||||||||||||||||
|Non INI vars.
|Set Any Variables Not Populated from the INI here
|/varset AnotherValue "Default Value"
/return
Sub TellCmds-personal
/declare counter local
/declare cmds local
/varset cmds ""
/for counter 0 to @ArrayPers
/varcat cmds "@Commands(0,@counter), "
/next counter
/call ChatOut 2 @MasterName "@cmds."
/return
|Things that you want to happen every loop through the macro go in this sub.
Sub PersonalMain
/Call StunOnCombat
/if ((@Combatstatus)==0) /call ResetFirstStun
/return
|Add your own Event and and other subroutines here
|Sub Event_EExample
| Some Event Code
|/return
Sub StunOnCombat
| Stunning npc on attack if @FirstStun is TRUE
/if ((@FirstStun) && (@Combatstatus) && ${Target.Distance}<200 && ${Target.Type.Equal[NPC]} && ${Me.SpellReady[Force of Akilae]}) {
/call SpellSub "Force of Akilae"
/varset FirstStun 0
| Stunning npc 50% of the time
} else {
/if (${Math.Rand[20]}>10 && (@Combatstatus) && ${Target.Distance}<200 && ${Target.Type.Equal[NPC]} && ${Me.SpellReady[Force of Akilae]}) {
/call SpellSub "Force of Akilae"
}
}
/return
Sub ResetFirstStun
| Reset FirstStun to TRUE when combat is over.
/varset FirstStun 1
/return
|Sub CommandFunction
| Some Code that will run every time CommandName is activated
|/return
I kept the original format of LG so you see what changes I made.
Looking forward to see what people put forth here.
Seagreen