Moderator: MacroQuest Developers

This is in the todo file: '$char(buff,x,name|duration|type) -- Still looking for buff slots...' We still need a memloc on the buffs, but they'll be there sometime.Sikk wrote:I have had a pretyy good look about at the samples I have seen here, I'm comfortable with the majority of the macro language (so far). But I have yet to see an example of a way to check if a buff is up on a toon (lets say the toon the macro is running on)
Yeah. Time how long SoW lasts. Subtract 1-2 minutes. Set up a timer.Sikk wrote:I have an application that would be much more effective if my little shaman would resow himself at a regular period.
Any suggestions?
Code: Select all
sub Main
...
/varset t14 27m
...
/return
sub Event_Timer
/if n $p0==14 {
/target myself
/cast "Spirit of Wolf"
}
/returnCode: Select all
#event_SOW "The spirit of Wolf leaves you"
<
.
.
Script
.
.
.>
sub event_SOW
/target myself
/cast <gem with sow in it>
/return

Code: Select all
| Buffslist.mac
| Created to list all your buffs and tell you how long is remaining on them.
|
#define DurationTick v12
#define DurationTotSec v13
#Define DurationHour v15
#Define DurationMin v14
#Define DurationSec v16
sub main
/for p1 1 to 15
/varset DurationHour 0
/varset DurationMin 0
/varset DurationTotSec 0
/varset DurationSec 0
/if "$char(buff,$p1)"=="NULL" /next p1
/varset DurationTick $char(buff,$p1,duration)
/echo For debug purposes, $char(buff,$p1) has $DurationTick ticks remaining.
/varcalc DurationTotSec $int($DurationTick*6)
/if n $DurationTotSec>=3600 {
/varcalc DurationHour $int($DurationTotSec/3600)
/varcalc DurationMin $int($DurationTotSec-($DurationHours*3600)/60
/varcalc DurationSec $DurationTotSec-(($DurationHour*3600)+($DurationMin*60)
} else
/if n $DurationTotSec>=60 {
/varcalc DurationMin $int($DurationTotSec/60)
/varcalc DurationSec $DurationTotSec-(DurationMin*60)
} else
/if n $DurationTotSec<60 {
/varset DurationSec $DurationTotSec
}
/echo $char(buff,$p1) in buff slot $p1 has $DurationHour hours, $DurationMin minutes, $DurationSec seconds remaining.
/mqlog $char(buff,$p1) in buff slot $p1 has $DurationHour hours, $DurationMin minutes, $DurationSec seconds remaining.
/next p1Code: Select all
[Wed Dec 11 xx:53:32 2002] [MacroQuest] For debug purposes, Spirit of Eagle has 696 ticks remaining.
[Wed Dec 11 xx:53:33 2002] Calculate encountered a '
[Wed Dec 11 xx:53:33 2002] Calculate encountered a '
[Wed Dec 11 xx:53:33 2002] Calculate encountered a '
[Wed Dec 11 xx:53:33 2002] [MacroQuest] Spirit of Eagle in buff slot 1 has 1.00 hours, 69.00 minutes, -1.00 seconds remaining.
[Wed Dec 11 xx:53:33 2002] Calculate encountered a '
[Wed Dec 11 xx:53:33 2002] [MacroQuest] For debug purposes, Nature's Might has 835 ticks remaining.
[Wed Dec 11 xx:53:33 2002] Calculate encountered a '
[Wed Dec 11 xx:53:33 2002] Calculate encountered a '
[Wed Dec 11 xx:53:33 2002] Calculate encountered a '
[Wed Dec 11 xx:53:33 2002] [MacroQuest] Nature's Might in buff slot 2 has 1.00 hours, 83.00 minutes, -1.00 seconds remaining.
[Wed Dec 11 xx:53:33 2002] Calculate encountered a '
[Wed Dec 11 xx:53:33 2002] [MacroQuest] For debug purposes, Protection of the Nine has 1178 ticks remaining.
[Wed Dec 11 xx:53:33 2002] Calculate encountered a '
[Wed Dec 11 xx:53:33 2002] Calculate encountered a '
[Wed Dec 11 xx:53:34 2002] Calculate encountered a '
[Wed Dec 11 xx:53:34 2002] [MacroQuest] Protection of the Nine in buff slot 3 has 1.00 hours, 117.00 minutes, -1.00 seconds remaining.
[Wed Dec 11 xx:53:34 2002] Calculate encountered a '
[Wed Dec 11 xx:53:34 2002] [MacroQuest] For debug purposes, Camouflage has 218 ticks remaining.
[Wed Dec 11 xx:53:34 2002] Calculate encountered a '
[Wed Dec 11 xx:53:34 2002] [MacroQuest] Camouflage in buff slot 4 has 0 hours, 21.00 minutes, -1.00 seconds remaining.
[Wed Dec 11 xx:53:34 2002] Calculate encountered a '
[Wed Dec 11 xx:53:34 2002] [MacroQuest] For debug purposes, Mask of the Hunter has 1056 ticks remaining.
[Wed Dec 11 xx:53:34 2002] Calculate encountered a '
[Wed Dec 11 xx:53:34 2002] Calculate encountered a '
[Wed Dec 11 xx:53:34 2002] Calculate encountered a '
[Wed Dec 11 xx:53:34 2002] [MacroQuest] Mask of the Hunter in buff slot 5 has 1.00 hours, 105.00 minutes, -1.00 seconds remaining.
[Wed Dec 11 xx:53:34 2002] Calculate encountered a '
[Wed Dec 11 xx:53:36 2002] [MacroQuest] For debug purposes, NULL has null ticks remaining.
[Wed Dec 11 xx:53:36 2002] Calculate encountered a '
[Wed Dec 11 xx:53:36 2002] [MacroQuest] NULL in buff slot 16 has 0 hours, 0 minutes, -1.00 seconds remaining.
[Wed Dec 11 xx:53:36 2002] Calculate encountered a '
[Wed Dec 11 xx:53:36 2002] Calculate encountered a '
[Wed Dec 11 xx:53:36 2002] Cleared the following: Timers Vars Arrays
[Wed Dec 11 xx:53:36 2002] The current macro has ended.Code: Select all
/varset DurationTick $char(buff,$p1,duration)
/echo For debug purposes, $char(buff,$p1) has $DurationTick ticks remaining.
/varset DurationTotSec $int($calc($DurationTick*6))
Code: Select all
/varcalc DurationHour $int($DurationTotSec/3600)
/varcalc DurationMin $int(($DurationTotSec-($DurationHour*3600))/60)
/varcalc DurationSec $DurationTotSec-($DurationHour*3600)+($DurationMin*60) Code: Select all
| Buffslist.mac
| Created to list all your buffs and tell you how long is remaining on them.
|
#define DurationTick v12
#define DurationTotSec v13
#Define DurationHour v15
#Define DurationMin v14
#Define DurationSec v16
#Define Temp v17
sub MAIN
/for p1 1 to 15
/varset DurationHour 0
/varset DurationMin 0
/varset DurationTotSec 0
/varset DurationSec 0
/varset Temp 0
/if "$char(buff,$p1)"=="NULL" /next p1
/varset DurationTick $char(buff,$p1,duration)
/varcalc DurationTotSec $int($DurationTick*6)
/if n $DurationTotSec>=3600 {
/varcalc DurationHour $int($DurationTotSec/3600)
/varcalc Temp $DurationHour*3600
/varsub DurationTotSec $Temp
/varcalc DurationMin $int($DurationTotSec/60)
/varcalc Temp $DurationMin*60
/varsub DurationTotSec $Temp
/varcalc DurationSec $DurationTotSec
/echo $char(buff,$p1) in buff slot $p1 has $DurationHour hour(s), $DurationMin minute(s), $DurationSec second(s) remaining.
/next p1
} else
/if n $DurationTotSec>=60 {
/varcalc DurationMin $int($DurationTotSec/60)
/varcalc Temp $DurationMin*60
/varsub DurationTotSec $Temp
/varcalc DurationSec $DurationTotSec
/echo $char(buff,$p1) in buff slot $p1 has $DurationMin minute(s), $DurationSec second(s) remaining.
/next p1
} else
/if n $DurationTotSec<60 {
/varcalc DurationSec $DurationTotSec
/echo $char(buff,$p1) in buff slot $p1 has $DurationSec second(s) remaining.
/next p1
}
/returnCode: Select all
[Wed Dec 11 xx:56:13 2002] [MacroQuest] Resist Cold in buff slot 1 has 35.00 minute(s), 36.00 second(s) remaining.
[Wed Dec 11 xx:56:13 2002] [MacroQuest] Nature's Might in buff slot 2 has 30.00 minute(s), 6.00 second(s) remaining.
[Wed Dec 11 xx:56:14 2002] [MacroQuest] Protection of the Nine in buff slot 3 has 1.00 hour(s), 4.00 minute(s), 24.00 second(s) remaining.
[Wed Dec 11 xx:56:14 2002] [MacroQuest] Replenishment in buff slot 4 has 19.00 minute(s), 12.00 second(s) remaining.
[Wed Dec 11 xx:56:14 2002] [MacroQuest] Mask of the Hunter in buff slot 5 has 52.00 minute(s), 18.00 second(s) remaining.
[Wed Dec 11 xx:56:15 2002] [MacroQuest] Brackencoat in buff slot 6 has 3.00 hour(s), 46.00 minute(s), 6.00 second(s) remaining.
[Wed Dec 11 xx:56:15 2002] [MacroQuest] Resist Fire in buff slot 7 has 35.00 minute(s), 48.00 second(s) remaining.
[Wed Dec 11 xx:56:16 2002] [MacroQuest] Spirit of Wolf in buff slot 8 has 38.00 minute(s), 54.00 second(s) remaining.
[Wed Dec 11 xx:56:16 2002] [MacroQuest] Levitation in buff slot 9 has 18.00 minute(s), 0.00 second(s) remaining.
[Wed Dec 11 xx:56:16 2002] [MacroQuest] Resist Poison in buff slot 10 has 37.00 minute(s), 0.00 second(s) remaining.
[Wed Dec 11 xx:56:17 2002] [MacroQuest] Shield of Bracken in buff slot 11 has 1.00 minute(s), 48.00 second(s) remaining.
[Wed Dec 11 xx:56:17 2002] [MacroQuest] Resist Disease in buff slot 12 has 39.00 minute(s), 24.00 second(s) remaining.
[Wed Dec 11 xx:56:17 2002] [MacroQuest] Harmony of Nature in buff slot 13 has 1.00 minute(s), 36.00 second(s) remaining.
[Wed Dec 11 xx:56:18 2002] [MacroQuest] Illusion: Fier`dal in buff slot 14 has 35.00 minute(s), 36.00 second(s) remaining.
[Wed Dec 11 xx:56:18 2002] [MacroQuest] Camouflage in buff slot 15 has 23.00 minute(s), 48.00 second(s) remaining.
[Wed Dec 11 xx:56:18 2002] [MacroQuest] NULL in buff slot 16 has 48.00 second(s) remaining.
[Wed Dec 11 xx:56:18 2002] Cleared the following: Timers Vars Arrays
[Wed Dec 11 xx:56:18 2002] The current macro has ended.Code: Select all
| Buffslist.mac
| Created to list all your buffs and tell you how long is remaining on them.
|
#define DurationTick v12
#define DurationTotSec v13
#Define DurationHour v15
#Define DurationMin v14
#Define DurationSec v16
#Define Temp v17
sub MAIN
/for p1 1 to 15
/varset DurationHour 0
/varset DurationMin 0
/varset DurationTotSec 0
/varset DurationSec 0
/varset Temp 0
/if "$char(buff,$p1)"!="NULL"
{
/varset DurationTick $char(buff,$p1,duration)
/varcalc DurationTotSec $int($DurationTick*6)
/if n $DurationTotSec>=3600
{
/varcalc DurationHour $int($DurationTotSec/3600)
/varcalc Temp $DurationHour*3600
/varsub DurationTotSec $Temp
/varcalc DurationMin $int($DurationTotSec/60)
/varcalc Temp $DurationMin*60
/varsub DurationTotSec $Temp
/varcalc DurationSec $DurationTotSec
/echo $char(buff,$p1) in buff slot $p1 has $DurationHour hour(s), $DurationMin minute(s), $DurationSec second(s) remaining.
} else /if n $DurationTotSec>=60
{
/varcalc DurationMin $int($DurationTotSec/60)
/varcalc Temp $DurationMin*60
/varsub DurationTotSec $Temp
/varcalc DurationSec $DurationTotSec
/echo $char(buff,$p1) in buff slot $p1 has $DurationMin minute(s), $DurationSec second(s) remaining.
} else
{
/varcalc DurationSec $DurationTotSec
/echo $char(buff,$p1) in buff slot $p1 has $DurationSec second(s) remaining.
}
}
/next p1
/returnThis is in the readme (FYI) .. "Checking buffs while on horseback = desktop"ap50 wrote:I actually have less problems with my version, than I do your re-write, so I'll stick with mine :)
ps Don't use this macro when you're on a horse, for some reason you'll get kicked to desktop.