1
Script Debug / First Script, help appreciated!
« on: May 06, 2016, 04:47:11 PM »
OK, so my very first script from scratch (be gentle). I've played around with others and I'm basically using snippets from different ones and what I've learned doing so to get started. Any help appreciated!
First Goal:
Use secondary character to repeatedly area peacemake and bandage primary character while being able to manually interrupt the loop to discord on my command.
So far I have two separate scripts that work-ish, but I would like to combine the two to accomplish my goal.
#1. Constant peacing and manual disco
gosub Peace
gosub Discord
sub Peace
{
event macro 13 9 ;peacemaking
target 5s
event macro 23 0 ;tgt self
wait 7s
return
}
sub Discord
{
scanjournal %i
if You_must_wait in #journal ;breaks peace loop
{
wait 7s ;provides time to use disco
scanjournal %i
if You_play in #journal ;disco success
{
wait 7s ;wait for skill cooldown
}
scanjournal %i
if You_attempt in #journal ;disco fail
{
wait 4s ;wait for skill cooldown
}
}
}
;goes back to peace loop
Two questions. Does my second set of journal scans actually work like I think it does (only testing on easy things as I'm spending more time on the code than in-game)? Secondly, does the journal scan only scan the last line in the journal?
#2. Constant healing and manual discord
gosub Heal
gosub Disco
sub Heal
{
event macro 17 ;use last object (bandage) (have to manually use before starting)
set #ltargetid KAYSSE ;change this depending on primary char
set #ltargetkind 1 ;is this line needed?
target 5s
event macro 22 ;last tgt (primary char)
wait 3s ;wait for bandage heal
return
}
sub Disco
{
scanjournal %i
if Choose in #journal ;used disco
{
wait 10s ;pause so bandage use doesn't cancel targeting
}
}
So I've tried to combine the two into one heal/peace/disco script but I keep shooting myself in the foot. Any pointers?
My LONG term goes is to be able to able to create something like:
heal primary when needed
constant peace loop
on primary character, through party chat - send monster ID to secondary character, break the heal/peace loop to disco the monster my primary is targeting
First Goal:
Use secondary character to repeatedly area peacemake and bandage primary character while being able to manually interrupt the loop to discord on my command.
So far I have two separate scripts that work-ish, but I would like to combine the two to accomplish my goal.
#1. Constant peacing and manual disco
gosub Peace
gosub Discord
sub Peace
{
event macro 13 9 ;peacemaking
target 5s
event macro 23 0 ;tgt self
wait 7s
return
}
sub Discord
{
scanjournal %i
if You_must_wait in #journal ;breaks peace loop
{
wait 7s ;provides time to use disco
scanjournal %i
if You_play in #journal ;disco success
{
wait 7s ;wait for skill cooldown
}
scanjournal %i
if You_attempt in #journal ;disco fail
{
wait 4s ;wait for skill cooldown
}
}
}
;goes back to peace loop
Two questions. Does my second set of journal scans actually work like I think it does (only testing on easy things as I'm spending more time on the code than in-game)? Secondly, does the journal scan only scan the last line in the journal?
#2. Constant healing and manual discord
gosub Heal
gosub Disco
sub Heal
{
event macro 17 ;use last object (bandage) (have to manually use before starting)
set #ltargetid KAYSSE ;change this depending on primary char
set #ltargetkind 1 ;is this line needed?
target 5s
event macro 22 ;last tgt (primary char)
wait 3s ;wait for bandage heal
return
}
sub Disco
{
scanjournal %i
if Choose in #journal ;used disco
{
wait 10s ;pause so bandage use doesn't cancel targeting
}
}
So I've tried to combine the two into one heal/peace/disco script but I keep shooting myself in the foot. Any pointers?
My LONG term goes is to be able to able to create something like:
heal primary when needed
constant peace loop
on primary character, through party chat - send monster ID to secondary character, break the heal/peace loop to disco the monster my primary is targeting