AlternateDefault: Difference between revisions

From CLUMP
Jump to navigationJump to search
m (→‎Dependencies: changed from tc to scanner)
Tag: Reverted
m (→‎Code: updated Default)
Tag: Reverted
Line 34: Line 34:
==Code==
==Code==
<pre>
<pre>
//------------------------------------------------
/* escape sequences:
// default
\\ backslash
//------------------------------------------------
\" double quote"
// This macro file is included for every character by default.
\r return
// Use it for general macros that you want available to all characters.
@name your character name
 
@rplayer selected player real name (with spaces) [NEW variable is @selplayer.name]
include "abbreviations.mac"
@splayer selected player simple name (no spaces) [NEW variable is
include "dances.mac"
@selplayer.simple_name]
include "directions.mac"
checking if something is in something else
include "funactions.mac"
>>> scanText.word[0] < "/"
include "omega_zu.mac"
@env Variables Variables with an @env prefix control how macros execute.
include "readtext.mac"
@env.echo (true/false) After any \r in a macro, replace the text in the input box by the text that was sent?
include "shares.mac"
@env.debug (true/false) Give extra information on macro loading and execution?
include "sunstone.mac"
@env.key_interrupts (true/false)
include "tc_macro.mac"
Stop executing a macro when a key is pressed?
include "quickchain.mac"
@env.click_interrupts
include "manticore.mac"
Stop executing a macro when you click in the game window (where clicks move your character)?
include "keys.mac"
include "moneycount.mac"
 
@my.variables
@login
Variables with a @my prefix concern your character.
{
@my.name Your character's name.
//::::::::::::::::::::::::::::::::::::::::::::::::
@my.simple_name Your character's simple name (no spaces or punctuation)
// Global Variables Defined
@my.[slot]_item The name of the item in the slot named. (Torso, Legs, Shoulder, Neck)
//::::::::::::::::::::::::::::::::::::::::::::::::
@my.right_item the name of the item in your right hand
// 20071229-inu: Moved out of abbreviations.mac & tc_macro.mac
@my.left_item the name of the item in your left hand
setglobal  NumZuBags 2 // the number of kudzu bags you carry, for some reason that scanner is in here
@my.forehead_item the name of the item on your forehead
setglobal  ThankRandom 1 // turns on thank random routine at startup for use with idle routine
@selplayer Variables Variables with a @selplayer prefix refer to the selected character.
setglobal  scanBreak 0 // Enables scanner to run continuously.
@selplayer.name Selected character's name.
setglobal  InfoExile 0 // Turns off exile info by default in AFK macro called on login, set can change it.
@selplayer.simple_name Selected character's simple name (no spaces or punctuation)
setglobal  MySunStone sungem // Set this to your sunstone, used in sunstone and tc_macro.
setglobal  IdleTime 100 // Set this to the desired pause time for idle macro (every 4 = 1 second approximately)
@click Variables Variables with a @click prefix refer to the character clicked on to begin a click macro.
setglobal  default_pie_target "DragonHawk" //Used by Pie-O-Matic in funactions.mac
@click.name The clicked on character's name.
setglobal  weapon_of_choice "moonstone"   //Used by Quickchain.mac to re-equip default right hand item.
@click.simple_name The clicked on character's simple name (no spaces or punctuation)
 
call MoneyCount
Miscellaneous Variables
call GoScan
@text The complete text in the typing box when the macro started.
}
(minus the expression (trigger) of an expression macro)
  @textsel The selected text in the typing box when the macro is started.
//::::::::::::::::::::::::::::::::::::::::::::::::
@random (no-repeat) A number between 0 and 9999, randomly generated each time this variable is referenced. form: random…or…or…end random
// Function key macros
  */
//::::::::::::::::::::::::::::::::::::::::::::::::
// This allow all key based macros to be called from here.
include "armor.txt"
// Makes it easier to track which keys are used for which macros.
include "creature-list.txt"
//
include "DynamicShareCads"
// F1 - embedded pull
include "ethereal_functions.txt"
// F2 - embedded push
include "funactions.txt"
// F3 - to moonstone.mac
include "Karma_Idle.txt"
// F4 - to moonstone.mac
include "KudzuLord-pop.txt"
// F5 - to quickchain.mac
include "quickchain.txt"
// F6 - to omega_zu.mac
include "sacko_zu.txt"
 
include "scanner.txt"
f1 "/pull " @splayer "\r"
include "rankcount.mac"
f2 "/push " @splayer "\r"
include "Shares.txt"
f3 call itemswap //f3 switches between an item and your moonstone,
shift-f3 call itemswap2 //When switching to the moonstone, you get a quick burst
control-F3 call ultcad
include "Storage.txt" //Geotzu's storage retrieval macro. works great!
control-shift-F3 call ultcad2
include "sunstone_messages.txt
f4 call cadswap
f5 call flybychain
include "track_it.mac"
f6 call zu-stuff
include "WTB.txt"
shift-f6 call zu-add
include "whatClass.txt"
ctrl-f6 call zu-remove
 
// Other keys
//***** Global Variables *****//
control-click2 call click-action // Quickchain.mac -- Needs to be reviewed, problematic.
click3 "/thank " @selplayer.simple_name "\r"
set toggle 0 // use "toggle" to toggle things on or off
control-click "/pull " @click.name "\r"
set Fighter[1] "Noivad"
control-shift-click "/push " @click.name "\r"
set Fighter[2] "Beer"
control-tab setglobal mStop 1
set Fighter[3] "Purrfect"
// wheelup call flybychain        // highly recommend against assigned anything to wheel up nor down
set Healer[1] "Thoomilicious"
// wheeldown call DHAwakeAFK        // unless you have a clicky wheel. Using this with a smooth
set Healer[2] "Asklepios"
                                              // scrolling mouse is not something to try,
"/login" call @login
                                              // use as you will have multiple calls to same macro. chain break!
click4 message ==> TESTING    // New mice have more than 3 buttons.
//Global Variables
 
//::::::::::::::::::::::::::::::::::::::::::::::::
set modeVerbose 0
// Macros called from login are defined here
//::::::::::::::::::::::::::::::::::::::::::::::::
set mStop 0
//
//------------------------------------------------
set longsleep 1
// Torin's Exile Picker Macro
set messageStart 0
//------------------------------------------------
set lsaveitem @my.left_item
// Picks a random exile
// 20080129-inu: Fixed to stop picking myself.
set rsaveitem @my.right_item
 
"/pick" call ExilePicker
set count 0
//
ExilePicker
set iAmAHealer 0
{
set startup 1
set numPlayers 0
"/select " @last "\r"
set toggle 0 // use "toggle" to toggle things on or off
set lastExile @selplayer.simple_name
set ritem
"/select " @first "\r"
  set defaultritem ""
set Exile[1] @selplayer.simple_name
if @selplayer.simple_name == lastExile
  set numPlayers 1
  goto ranPicker
@login
end if
{
set exileCounter 1
call time_stamp_check
 
pause 1
label exileCountLoop
call whoami
  "/select " @next "\r"
pause 5
  set exileCounter + 1
call GoScan
  set Exile[exileCounter] @selplayer.simple_name
  }
  if @selplayer.simple_name == lastExile
    set numPlayers exileCounter
time_stamp_check
    goto ranPicker
{
  end if
set TextToCheck @env.textLog.word[0].letter[0]
goto exileCountLoop
 
//message "text to check is: " TextToCheck
label ranPicker
  set ranPick @random
  if  TextToCheck > 0
  set ranPick % numPlayers
setglobal messageStart 2
  set ranPick + 1
setglobal timestamps 1
  set testexile Exile[ranPick]
message "*time stamps are On"
  if testexile == @my.simple_name
  else
set ranPick +1
message "*time stamps are off"
  end if
setglobal messageStart 0
  setglobal randomExileClanning Exile[ranPick]
setglobal timestamps 0
  "/select " randomExileClanning "\r"
label endexilepicker
}
 
//------------------------------------------------
// GoScan and Scanner macros (Noivad's + ?)
//------------------------------------------------
"goscan" call GoScan
GoScan
{
set @env.key_interrupts false //when you start you want it to loop
set @env.click_interrupts false //these two lines makes sure it doesn't shut off
if messageStatus == 1
message "Scanner On:"
pause 8
end if
if @text == "?"
message "Type \"/t?\" to find the target."
pause 8
message "Type \"/ts <name> [text]\" sets the target and sends them a message if you include one."
pause 8
message "Type \"/set feedback [1|0|on|off]\" to toggle feedback on|off."
pause 8
message "Type \"noscan\" to stop GoScan and DHAwakeAFK."
end if
"/pose lie\r"
if @my.name == "Inu Teisei"
"/action naps like DH \r"
else
"/action is sleeping \r"
end if
message **Idling with anti time-out active.
call Scanner
}
 
//------------------------------------------------
// Scanner Macro (Noivad's + ?)
//------------------------------------------------
Scanner
{
  // Rev 2.0
  // RevLog:
  // 20071231-inu: Integrated DH's AwakeAFK macro with this scanner to avoid problems and auto call on login
  // 20080128-inu: Removed excessive pause in integrated DHAwakeAFK integrated counter instead.
  //       Integrated Raul's trainer message reader.
 
  set IdleCount 0
  label scanTop
pause 1
if scanBreak == 1
goto scanEnder
else
//------------------------------------------------
// BEGIN: Scan for Text Section
//------------------------------------------------
set scanText @env.textLog
if scanText.word[0] < "/"
setglobal timeStamps 3
setglobal playerName 2
setglobal me 6
else
setglobal timeStamps 1
setglobal playerName 0
setglobal me 3
end if
if scanText.word[timeStamps] == "thinks" //with timestamps[3] w/o [1]
if scanText < "thinks to you, \""
if ssTarget != scanText.word[playerName] //w/timestamps[2] w/o[0]
if scanText.word[playerName] != @my.name
setglobal ssTarget scanText.word[playerName]
setglobal feedback 1 //turn on feedback for new target
pause 4
set IdleCount + 4
end if
end if
if messageStatus == 1 //this controls overall feedback
//This if block turns off feedback when the target hasn't changed
if feedback == 1
message "/tl target: " ssTarget
setglobal feedback 0
end if
end if
end if
else if scanText < "Captain Barnac asks, \"Ah, "
set namePer @my.name
set namePer + "."
if scanText.word[me] == namePer
pause 1
set IdleCount + 1
"yes\r"
end if
else if scanText < "Paul Deckand asks, \"Ah, "
set namePer @my.name
set namePer + "."
if scanText.word[me] == namePer
pause 1
set IdleCount + 1
"yes\r"
end if
else if scanText < "Fird Lirden asks, \"Ah, "
set namePer @my.name
set namePer + "."
if scanText.word[me] == namePer
pause 1
set IdleCount + 1
"yes\r"
end if
else if scanText < "* You don't have anything like that"
if bag_number < NumZuBags
setglobal bag_number + 1
message "*bag set to " bag_number
"/equip bag of kudzu seedlings " bag_number "\r"
else if bag_number > NumZuBags
setglobal bag_number 1
"/equip bag of kudzu seedlings " bag_number "\r"
end if
pause 8
set IdleCount + 8
else if scanText < "You have no 'bag of kudzu seedlings"
setglobal bag_number 1
"/equip bag of kudzu seedlings " bag_number "\r"
else
pause 1
set IdleCount + 1
end if
//------------------------------------------------
// END: Scan for Text Section
//------------------------------------------------
// START: DHAwakeAFK integration
//------------------------------------------------
// Credits: Idle and awakeafk macros by DragonHawk
// Adding Idle macro to this one big loop to stop possible conflicts between the two
if IdleCount > IdleTime // Only execute this part one time per IdleTime period
random
message ::** ThankRandomExile **::
if ThankRandom == 1
call ExilePicker
"/karma " randomExileClanning " \r"
"/thank " randomExileClanning " **Yay! You won the thank lottery! ;p \r"
end if
"/pose stand se \r"
or
message ::** CheckMoney **::
"/money \r"
if InfoExile == 1
"/info " randomExileClanning " \r"
end if
"/pose thoughtful \r"
or
message ::** InfoRandomExile **::
"/pose stand \r"
"/pose sit "
if InfoExile == 1
"/info " randomExileClanning " \r"
end if
end random
"/karma \r"
set IdleCount 0
end if
set IdleCount + 1
//------------------------------------------------
// END: DHAwakeAFK integration
//------------------------------------------------
// START: Readtext.mac by Raul integration
//------------------------------------------------
setglobal gtrainerPhrase scanText
call rankcount
//------------------------------------------------
// END: Readtext.mac - trainer message by Raul integration
//------------------------------------------------
goto scanTop
end if  // Scanner Loop
label buggy //After time some infinite loops run away
Message "Bug Detected:" //on you. So, I place these messages
pause 2 //in to let you know if the macro
Message "**Use <CTRL>-TAB to halt***" //has jumped out of the regular loop
pause 120 //<--gives you time to escape the loop.
 
label scanEnder
if messageStatus == 1
message "Scanner Off"
end if
set @env.key_interrupts true //Kludges to try to stop a run away macro
set @env.click_interrupts true //Kludges
pause 300 //Kludges
}
 
//------------------------------------------------
// Global SET macro (Noivad's + ?)
//------------------------------------------------
"/set" //non-optimized to add: messageVariable and call InstructionMessages
{
if @text.word[0] == "verbose"
if @text.word[1] == "?"
message "* This variable sets whether or not to associate an \"/action\" or \"/narrate\" with a macro."
pause 16
message "\"1\" is on, \"0\" is off."
if modeVerbose == 0
message "*Verbose mode is off."
else
message "*Verbose mode is on."
end if
else
if @text.word[1] == 1
setglobal modeVerbose @text.word[1]
else if @text.word[1] == 0
setglobal modeVerbose @text.word[1]
else
message "Error: Verbose Mode must be set to 0 or 1."
goto end
end if
if modeVerbose == "1"
message "*Verbose mode: On."
else if modeVerbose == "0"
message "*Verbose mode: Off."
end if
end if
else if @text.word[0] == "debug"
if @text.word[1] == "?"
message "*This variable sets whether debugger messages are displayed when testing a macro."
pause 12
if debug == 0
message "*debug is off."
else
message "*debug mode is on."
end if
else if @text.word[1] == 1
setglobal debug @text.word[1]
else if @text.word[1] == 0
setglobal debug @text.word[1]
else if @text.word[1] == "on"
setglobal debug 1
else if @text.word[1] == "off"
setglobal debug 0
else
message "Error: Debug Mode must be set to 0 or 1, or off and on."
goto end
end if
message "debug is set to: " debug
else if @text.word[0] == "longsleep"
if @text.word[1] == "?"
message "*This variable is used to toggle the long sleep macro \"on\" and \"off\"."
if longsleep == 0
message "*longsleep is off."
else
message "*longsleep is on."
end if
else if @text.word[1] == "off"
setglobal longsleep 0
message "*longsleep is off."
else if @text.word[1] == "on"
setglobal longsleep 1
message "*longsleep is on."
end if
else if @text.word[0] == "bag"
if @text.word[1] == "?"
message "*This variable is used to select a bag number to use for kudzu planting."
message "the current bag is " bag_number "."
end if
if @text.word[1] > 0
setglobal bag_number @text.word[1]
"/selectitem \"bag of kudzu seedlings <#" bag_number "\"\r"
message "the current bag is " bag_number "."
end if
else if @text.word[0] == "maxbag"
if @text.word[1] == "?"
message "*This variable is used to set how many kudzu bags you have on you."
message "the number of kudzu bags is " max_bag "."
end if
if @text.word[1] > 0
setglobal max_bag @text.word[1]
message "you number of kudzu bags is set at " max_bag "."
end if
else if @text.word[0] == "loc"
if @text.word[1] == ""
setglobal FallingAt ""
setglobal FallingLocSet 0
message fallingAt set with \"set loc\" to NADA
else if @text.word[1] == "list"
message fallingAt set with \"set loc\" to FallingAt
else
setglobal FallingAt ""
setglobal FallingAt @text
setglobal FallingLocSet 1
message fallingAt set with \"set loc\" to FallingAt
end if
else if @text.word[0] == "thankrandom"
if @text.word[1] == ""
setglobal ThankRandom 0
message "ThankRandom turned off"
else if @text.word[1] == "?"
if ThankRandom == 1
message "ThankRandom is currently on"
else
message "ThankRandom is currently OFF"
end if
else if @text.word[1] == "on"
setglobal ThankRandom 1
message "ThankRandom is currently on"
else if @text.word[1] == "off"
setglobal ThankRandom 0
message "ThankRandom is currently OFF"
else
// default without params is to turn ThankRandom ON
setglobal ThankRandom 1
message "ThankRandom is currently on"
end if
else if @text.word[0] == "infoexile"
if @text.word[1] == ""
setglobal InfoExile 0
message "InfoExile turned off"
else if @text.word[1] == "?"
if InfoExile == 1
message "InfoExile is currently on"
else
message "InfoExile is currently OFF"
end if
else if @text.word[1] == "on"
setglobal InfoExile 1
message "InfoExile is currently on"
else
// default without params is to turn InfoExile OFF
setglobal InfoExile 0
message "InfoExile is currently OFF"
end if
else if @text.word[0] == "feedback"
if @text.word[1] == "?"
message "Set feedback off macros to be <on|1> or <off|0>"
                      if messageStatus == 0
                          set feedback "off"
                      else if  messageStatus == 1
                          set feedback "on"
                      end if
                      message "feedback is " feedback
                             
else if @text.word[1] == "on"
setglobal messageStatus 1
                        message "feedback is on"
else if @text.word[1] == "off"
setglobal messageStatus 0
                else if @text.word[1] == "1"
setglobal messageStatus @text.word[1]
                        message "feedback is on"
else if @text.word[1] == "0"
setglobal messageStatus @text.word[1]
end if
else if @text.word[0] == "pie"
if @text.word[1] == "?"
message "Set the default pie target used by /pie, /pom"
message "Current target is " default_pie_target
else if @text.word[1] == ""
setglobal default_pie_target @selplayer.simple_name
message "New default pie target is: " default_pie_target
else
setglobal default_pie_target @text.word[1]
message "New default pie target is: " default_pie_target
end if
else
message "*The following variables are available to set using this command:"
pause 4
message "*verbose [0|1|?], longsleep [on|off|?]"
pause 4
message "feedback [1|0|on|off]"
pause 4
message "*clock, bag [(number)], maxbag (number), wh(isper) [on|off], debug [on|1|off|0]"
pause 4
message "loc [areaname], "thankrandom [on|off|?], infoexile [off|on|?]"
pause 4
message "pie [targetname or selected in playerlist|?]"
end if
 
label end
}
 
"noscan"
{
  setglobal scanBreak 1 //This alows you to stop this macro without stopping other macros
}
 
// Wait or sleep, by Phineas
 
setglobal zzToggle 0
 
"zz"
{
  if zzToggle == 1
message "zz - zzToggle=1"
setglobal zzToggle 0
  else if zzToggle == 0
message "zz - zzToggle=0"
setglobal zzToggle 1
setglobal sleepToggle 1
   end if
   end if
call wait_routine
  message "type '/set ?' for optional settings"
}
  }
 
"zzz"
{
"/whoami" call whoami
if zzToggle == 1
message "zzz - zzToggle=1"
whoami
setglobal zzToggle 0
{
else if zzToggle == 0
if @my.simple_name == Healer[2]
message "zzz - zzToggle=0"
setglobal iAmAHealer 2
setglobal zzToggle 1
setglobal healingDevice "Asklepian"
"\pose lie\r"
setglobal defaultritem "moonstone"
"\sleep\r"
setglobal myWeapon "Roguewood club"
setglobal sleepToggle 1
"/unequip @my.right_item\r"
end if
"/equip " defaultritem "\r"
call wait_routine
call RC_thoomi_setup
}
message "*Default:healmode:thoomi!*"
 
else if @my.simple_name == Healer[1]
wait_routine
setglobal iAmAHealer 1
{
setglobal healingDevice "Asklepian Staff"
label wr_01
setglobal defaultritem "moonstone"
//message "wait routine - top"
setglobal myWeapon "cutlas"
if zzToggle == 1
"/unequip @my.right_item\r"
pause 400
call RC_thoomi_setup
random
message "*Default:healmode:thoomi!*"
{
"/equip " defaultritem "\r"
message "wr - random -1- karma"
else if @my.simple_name == Fighter[1]
"\karma\r"
setglobal iAmAHealer 0
pause 100
setglobal defaultritem "gossamer"
or
setglobal myWeapon "gossamer"
message "wr - random -1- money"
"/unequip @my.right_item\r"
"\money\r"
if @my.right_item != myWeapon
pause 100
"/equip " myWeapon "\r"
or
end if
message "wr - random -1- dreaming"
call RC_fighter_setup
"\sleep \r"
//call examinearmor
pause 100
else if @my.simple_name == Fighter[2]
end random
setglobal iAmAHealer 0
}
setglobal defaultritem "Axe"
goto wr_01
setglobal myWeapon "Axe"
end if
"/unequip @my.right_item\r"
message "*zz is Off"
"/equip " myWeapon "\r"
}
else if @my.simple_name == Fighter[3]
setglobal iAmAHealer 0
setglobal defaultritem "Bloodblade"
setglobal myWeapon "Bloodblade"
"/unequip @my.right_item\r"
"/equip " myWeapon "\r"
call RC_purr_setup
end if
message "*Default: right hand item set to a " defaultritem "."
if iAmAHealer == 1
message "*healingDevice set to " healingDevice
call "RC_thoomi_setup"
else if iAmHealer == 0
message "* Your Weapon of choice is a" myWeapon
call "RC_fighter_setup"
end if
message "welcome " @my.simple_name
}
command-f2
{
setglobal ritem @my.right_item
message "ritem is: " ritem
if ritem == "nothing"
"/equip " defaultritem "\r"
else
setglobal rsaveitem ritem
"/unequip right\r"
end if
}
"/eps"
{
setglobal ritem @my.right_item
message "ritem is: " ritem
if ritem != "EtherealPortalStone"
setglobal rsaveitem ritem
"/equip etherealportalstone \r"
if @text.word[0] == "check"
message ***EPS Ready***
goto end
end if
end if
"/use\r"
label end
}
/* ***** QuickActions ***** */
"??"    "/help "      @text "\r"
"aa"    "/action "    @text "\r"
"ex" "excuse me\r"
"gg"    "/give "      @text "\r"
"ii"    "/info "      @text "\r"
"kk"    "/karma "      @text "\r"
"m" "/money "  @text "\r"
"mm"    "/money "      @text "\r"
"nn" "/narrate " @text "\r"
"np" "no problem\r"
"pp"    "/ponder "    @text "\r"
//"sh"    "/share "      @text "\r"  //removed for Shares.txt macro version
"sl"    "/sleep "      @text "\r"
"t"      "/think "      @text "\r"
//"tt"    "/thinkto "    @text "\r" //removed for Scanner.txt version
"th"    "/thank "      @text "\r"
"uu"    "/use "        @text "\r"
"un"    "/unshare "    @text "\r"
"w"      "/who "        @text "\r"
"wh"    "/whisper "    @text "\r"
"yy"    "/yell "      @text "\r"
"hehe" call lol
lol
{
if @my.name == "Purrfect"
"/action purrs " @text "\r"
else
"/action laughs " @text "\r"
end if
}
"heh" call lol
"/grats" call Grats
Grats
{
set xNumber @random
set xNumber % 20
if xNumber < 5
set xNumber 6
end if
message "*Congratulations in " xNumber "/5 Seconds."
pause xNumber
random
"/think Excellent!, Congratulations\r"
or
"/think Congrats!\r"
or
"/think Good Job!\r"
end random
}
/* ****** Push/Pull ***** */
F2 "/push " @splayer "\r"
//control-option-click "/push " @click.name "\r"
//* ***** QuickPoses ***** */
home "/pose angry \r"
help "/pose leanleft \r"
pageup "/pose akimbo\r"
option-pageup "/pose celebrate\r"
shift-option-pageup "/pose thoughtful\r"
pagedown "/pose seated \r"
option-pagedown "/pose kneel\r"
shift-option-pagedown "/pose bow \r"
pageright "/pose leanright\r"
option-right "/pose walkright\r"
command-right "/pose leanright\r"
shift-option-right "/pose angry\r"
pageleft "/pose leanleft\r"
command-left "/pose leanleft\r"
option-left "/pose surprise\r"
shift-option-left "/pose walkleft \r"
"sel" "/select "  @text "\r"
"u" "/use " @text "\r"
"ui" "/useitem " @text "\r"
"y" "/yell " @text "\r"
"yh" "/yell here! fallen \r"
"uuu" "/use " @splayer "\r"
"uuuu" "/use " @splayer "\r"
"unsh" "/unshare " @splayer "\r"
"wave" "/action waves \r"
"yawn" "/action yawns.\r"
"yybrb" "/yell Be right back\r"
"yye" "/yell East\r"
"yyn" "/yell North\r"
"yys" "/yell South\r"
"yyw" "/yell West\r"
"yret" "/yell Retreat!\r"
"yy>" "/yell East>>>\r"
"yy<" "/yell <<<West\r"
'>>>' "East>>>"
'<<<' "<<<West"
ArmUp
{
if @my.right_item != myWeapon
setglobal rItem @my.right_item
"/equip " myWeapon "\r"
"/options icon armed\r"
end if
}
ArmDown
{
if @my.right_item == myWeapon
"/equip " rItem "\r"
"/options icon unarmed\r"
end if
}
// modeVerbose is a global variable intended to be included in macros
// that have actions attached to them. place a test reading:
// "if modeVerbose == 1" before the actions
//non-optimized to add: message Variable and call Instruction
"/set"
{
if @text.word[0] == "?"
message "***The following variables are available to set using this command:"
pause 5
message "*verbose [0|1|?], longsleep [on|off|?]"
pause 5
message "*clock, bag [(number)], maxbag (number), wh(isper) [on|off], debug [on|1|off|0]"
pause 5
message "*feedback [on|1|off|0], tgn [number],* F1-2: pull/push, F5: chain "
pause 5
message "*[ranger] tr <name>,* escape: shieldstone, F4:heartwood,F11: sky bison "
message "***End Help***"
else if @text.word[0] == "verbose"
if @text.word[1] == "?"
message "* This variable sets whether or not to associate an \"/action\" or \"/narrate\" with a macro."
pause 20
message "\"1\" is on, \"0\" is off."
if modeVerbose == 0
message "*Verbose mode is off."
else
message "*Verbose mode is on."
end if
else
if @text.word[1] == 1
setglobal modeVerbose @text.word[1]
else if @text.word[1] == 0
setglobal modeVerbose @text.word[1]
else if @text.word[1] == "on"
setglobal modeVerbose 1
else if @text.word[1] == "off"
setglobal modeVerbose 0
else
message "Error: Verbose Mode must be set to 0|off|1|on."
goto end
end if
if modeVerbose == "1"
message "*Verbose mode: On."
else if modeVerbose == "0"
message "*Verbose mode: Off."
end if
end if
else if @text.word[0] == "debug"
if @text.word[1] == "?"
message "*This variable sets whether debugger messages are displayed when testing a macro."
pause 15
if debug == 0
message "*debug is off."
else
message "*debug mode is on."
end if
else if @text.word[1] == 1
setglobal debug @text.word[1]
else if @text.word[1] == 0
setglobal debug @text.word[1]
else if @text.word[1] == "on"
setglobal debug 1
else if @text.word[1] == "off"
setglobal debug 0
else
message "Error: Debug Mode must be set to 0 or 1, or off and on."
goto end
end if
message "debug is set to: " debug
else if @text.word[0] == "longsleep"
if @text.word[1] == "?"
message "*This variable is used to toggle the long sleep macro \"on\" and \"off\"."
if longsleep == 0
message "*longsleep is off."
else
message "*longsleep is on."
end if
else if @text.word[1] == "off"
setglobal longsleep 0
message "*longsleep is off."
else if @text.word[1] == "on"
setglobal longsleep 1
message "*longsleep is on."
else if if @text.word[1] == 0
setglobal longsleep 0
message "*longsleep is off."
else if if @text.word[1] == 1
setglobal longsleep 1
message "*longsleep is on."
end if
else if @text.word[0] == "bag"
if @text.word[1] == "?"
message "*This variable is used to select a bag number to use for kudzu planting."
message "the current bag is " bag_number "."
end if
if @text.word[1] > 0
setglobal bag_number @text.word[1]
"/selectitem \"bag of kudzu seedlings <#" bag_number "\"\r"
message "the current bag is " bag_number "."
end if
else if @text.word[0] == "maxbag"
if @text.word[1] == "?"
message "*This variable is used to set how many kudzu bags you have on you."
message "the number of kudzu bags is " max_bag "."
end if
if @text.word[1] > 0
setglobal max_bag @text.word[1]
message "you number of kudzu bags is set at " max_bag "."
end if
else if @text.word[0] == "feedback"
if @text.word[1] == "?"
message "*This variable sets whether some macros give feedback as to their status."
pause 15
if feedback == 0
message "*feedback is off."
else
message "*feedback is on."
end if
else if @text.word[1] == 1
setglobal feedback @text.word[1]
else if @text.word[1] == 0
setglobal feedback @text.word[1]
else if @text.word[1] == "on"
setglobal feedback 1
else if @text.word[1] == "off"
setglobal feedback 0
else
message "Error: Debug Mode must be set to 0 or 1, or off and on."
goto end
end if
message "feedback is set to: " feedback
else if @text.word[0] == "tgn"
if @text.word[1] == ""
setglobal thankTarget 1
else
setglobal thankTarget @text.word[1]
end if
call WhoAmIThanking
else
setglobal @text.word[0] @text.word[1]
message @text.word[0] " is " @text.word[1]
end if
label end
}
include "RC2.txt"
</pre>
</pre>



Revision as of 13:51, 21 October 2024

Description

  • An alternate default which incorporates global variables so main items are set in this area vice being set in individual macro files - e.g. Sunstone.

Dependencies

Usage

  • Save code section into file called Default in your clanlord/data/macros folder.

Noteworthy techniques

  • Usage of SET function to set variables, on the fly while clanning without having to reload macros.
  • Usage of Global Variables to allow define once, use everywhere.
    • Avoids the hassle of editing macros to change an item to it's upgraded variant everywhere that item is referrred to.
  • All key/mouse actions defined centrally.
    • Requires called macro be defined in an included file.
    • Requires that no key/mouse actions be defined in any other file.
    • Makes it simple to figure out which keys you have not assigned yet.
  • Single scan/loop - to prevent conflicting never ending loops.
    • NOW INCLUDES: Raul's readtext trainer messages to prevent overlap.
  • Automatic idle startup.
    • Some things will still kill it, so to restart, reload macros (CTRL+R).
  • Moved all but global procedures out of default into dedicated files to clean up default and avoid the feeling that you are swimming through an encyclopedia.

Credits

  • DragonHawk - AwakeAFK
  • Gorvin - Shares
  • Inu - Random thank, single instance definitions, integration of various other macros into this Alternate Default, moving stuff not required for scanner/set global into their own dedicated file.
  • Kiriel D'Sol - Directions
  • Noivad - Moneycount, Omega_Zu, Quickchain, Sunstone, tc_macro,
  • Phineas - idle
  • Raul - Readtext (trainer messages)
  • Torin - Exilepicker

Code

/* escape sequences:
 	\\				backslash
 	\"				double quote"
 	\r				return
 	@name			your character name
 	@rplayer		selected player real name (with spaces) [NEW variable is @selplayer.name]
 	@splayer		selected player simple name (no spaces) [NEW variable is
 @selplayer.simple_name]
 checking if something is in something else
 >>> scanText.word[0] < "/"
 @env Variables			Variables with an @env prefix control how macros execute.
 @env.echo (true/false) 	After any \r in a macro, replace the text in the input box by the text that was sent?
 @env.debug (true/false)	Give extra information on macro loading and execution?
 @env.key_interrupts (true/false)
 Stop executing a macro when a key is pressed?
 @env.click_interrupts
 Stop executing a macro when you click in the game window (where clicks move your character)?
 
 
 @my.variables
 Variables with a @my prefix concern your character.
 @my.name		 	Your character's name.
 @my.simple_name	Your character's simple name (no spaces or punctuation)
 @my.[slot]_item	The name of the item in the slot named. (Torso, Legs, Shoulder, Neck)
 @my.right_item	the name of the item in your right hand
 @my.left_item		the name of the item in your left hand
 @my.forehead_item	the name of the item on your forehead
 @selplayer Variables	Variables with a @selplayer prefix refer to the selected character.
 @selplayer.name		Selected character's name.
 @selplayer.simple_name	Selected character's simple name (no spaces or punctuation)
 
 @click Variables	Variables with a @click prefix refer to the character clicked on to begin a click macro.
 @click.name		The clicked on character's name.
 @click.simple_name	The clicked on character's simple name (no spaces or punctuation)
 
 Miscellaneous Variables
 @text		The complete text in the typing box when the macro started.
 (minus the expression (trigger) of an expression macro)
 @textsel	The selected text in the typing box when the macro is started.
 @random	(no-repeat)	A number between 0 and 9999, randomly generated each time this variable is referenced. form: random…or…or…end random
 */
 
 include "armor.txt"
 include "creature-list.txt"
 include "DynamicShareCads"
 include "ethereal_functions.txt"
 include "funactions.txt"
 include "Karma_Idle.txt"
 include "KudzuLord-pop.txt"
 include "quickchain.txt"
 include "sacko_zu.txt"
 include "scanner.txt"
 include "rankcount.mac"
 include "Shares.txt"
 
 
 include "Storage.txt" //Geotzu's storage retrieval macro. works great!
 include "sunstone_messages.txt
 
 include "track_it.mac"
 include "WTB.txt"
 include "whatClass.txt"
 
 
 //***** Global Variables *****//
 
 set toggle 0 // use "toggle" to toggle things on or off
 set Fighter[1] "Noivad"
 set Fighter[2] "Beer"
 set Fighter[3] "Purrfect"
 set Healer[1] "Thoomilicious"
 set Healer[2] "Asklepios"
 "/login" call @login
 
 //Global Variables
 
 set modeVerbose 0
 
 set mStop 0
 
 set longsleep 1
 set messageStart 0
 set lsaveitem @my.left_item
 
 set rsaveitem @my.right_item
 
 set count 0
 
 set iAmAHealer 0
 set startup 1
 
 set toggle 0 // use "toggle" to toggle things on or off
 set ritem
 set defaultritem ""
 
 
 
 @login
 {
 call time_stamp_check
 pause 1
 call whoami
 pause 5
 call GoScan
 }
 
 time_stamp_check
 {
 set TextToCheck @env.textLog.word[0].letter[0]
 
 //message "text to check is: " TextToCheck
 
  if  TextToCheck > 0
 	 setglobal messageStart 2
 	 setglobal timestamps 1
 	 message "*time stamps are On"
  else
 	 message "*time stamps are off"
 	 setglobal messageStart 0
 	 setglobal timestamps 0
  end if
  message "type '/set ?' for optional settings"
  }
 
 
 "/whoami" call whoami
 
 whoami
 {
 if @my.simple_name == Healer[2]
 	setglobal iAmAHealer 2
 	setglobal healingDevice "Asklepian"
 	setglobal defaultritem "moonstone"
 	setglobal myWeapon "Roguewood club"
 	"/unequip @my.right_item\r"
 	"/equip " defaultritem "\r"
 	call RC_thoomi_setup
 	message "*Default:healmode:thoomi!*"
 else if @my.simple_name == Healer[1]
 	setglobal iAmAHealer 1
 	setglobal healingDevice "Asklepian Staff"
 	setglobal defaultritem "moonstone"
 	setglobal myWeapon "cutlas"
 	"/unequip @my.right_item\r"
 	call RC_thoomi_setup
 	message "*Default:healmode:thoomi!*"
 	"/equip " defaultritem "\r"
 else if @my.simple_name == Fighter[1]
 	setglobal iAmAHealer 0
 	setglobal defaultritem "gossamer"
 	setglobal myWeapon "gossamer"
 	"/unequip @my.right_item\r"
 	if @my.right_item != myWeapon
 		"/equip " myWeapon "\r"
 	end if
 	call RC_fighter_setup
 	 //call examinearmor
 else if @my.simple_name == Fighter[2]
 	setglobal iAmAHealer 0
 	setglobal defaultritem "Axe"
 	setglobal myWeapon "Axe"
 	"/unequip @my.right_item\r"
 	"/equip " myWeapon "\r"
 else if @my.simple_name == Fighter[3]
 	setglobal iAmAHealer 0
 	setglobal defaultritem "Bloodblade"
 	setglobal myWeapon "Bloodblade"
 	"/unequip @my.right_item\r"
 	"/equip " myWeapon "\r"
 	call RC_purr_setup
 end if
 
 message "*Default: right hand item set to a " defaultritem "."
 
 if iAmAHealer == 1
 	message "*healingDevice set to " healingDevice
 	call "RC_thoomi_setup"
 
 else if iAmHealer == 0
 	message "* Your Weapon of choice is a" myWeapon
 	call "RC_fighter_setup"
 end if
 message "welcome " @my.simple_name
 }
 
 command-f2
 {
 setglobal ritem @my.right_item
 message "ritem is: " ritem
 if ritem == "nothing"
 	"/equip " defaultritem "\r"
 
 else
 	setglobal rsaveitem ritem
 	"/unequip right\r"
 end if
 }
 
 "/eps"
 {
 setglobal ritem @my.right_item
 message "ritem is: " ritem
 if ritem != "EtherealPortalStone"
 	setglobal rsaveitem ritem
 	"/equip etherealportalstone \r"
 	if @text.word[0] == "check"
 		message ***EPS Ready***
 		goto end
 	end if
 
 end if
 "/use\r"
 label end
 }
 
 
 /* ***** QuickActions ***** */
 "??"    "/help "       @text "\r"
 "aa"    "/action "     @text "\r"
 "ex"	"excuse me\r"
 "gg"    "/give "       @text "\r"
 "ii"    "/info "       @text "\r"
 "kk"    "/karma "      @text "\r"
 "m"		"/money "   @text "\r"
 "mm"     "/money "      @text "\r"
 "nn"	"/narrate " @text "\r"
 "np"	"no problem\r"
 "pp"     "/ponder "     @text "\r"
 //"sh"     "/share "      @text "\r"  //removed for Shares.txt macro version
 "sl"     "/sleep "      @text "\r"
 "t"      "/think "      @text "\r"
 //"tt"     "/thinkto "    @text "\r" //removed for Scanner.txt version
 "th"     "/thank "      @text "\r"
 "uu"     "/use "        @text "\r"
 "un"     "/unshare "    @text "\r"
 "w"      "/who "        @text "\r"
 "wh"     "/whisper "    @text "\r"
 "yy"     "/yell "       @text "\r"
 "hehe"	call lol
 lol
 {
 if @my.name == "Purrfect"
 	"/action purrs " @text "\r"
 else
 	"/action laughs " @text "\r"
 end if
 }
 "heh"	call lol
 
 
 "/grats" call Grats
 Grats
 {
 set xNumber @random
 set xNumber % 20
 if xNumber < 5
 	set xNumber 6
 end if
 
 message "*Congratulations in " xNumber "/5 Seconds."
 pause xNumber
 
 random
 	"/think Excellent!, Congratulations\r"
 or
 	"/think Congrats!\r"
 or
 	"/think Good Job!\r"
 end random
 
 }
 
 /* ****** Push/Pull ***** */
 F2 "/push " @splayer "\r"
 //control-option-click	"/push " @click.name "\r"
 
 //* ***** QuickPoses ***** */
 home					"/pose angry \r"
 help					"/pose leanleft \r"
 pageup					"/pose akimbo\r"
 option-pageup 			"/pose celebrate\r"
 shift-option-pageup 	"/pose thoughtful\r"
 pagedown				"/pose seated \r"
 option-pagedown 		"/pose kneel\r"
 shift-option-pagedown 	"/pose bow \r"
 pageright					"/pose leanright\r"
 option-right 			"/pose walkright\r"
 command-right			"/pose leanright\r"
 shift-option-right		"/pose angry\r"
 pageleft					"/pose leanleft\r"
 command-left 			"/pose leanleft\r"
 option-left				"/pose surprise\r"
 shift-option-left 		"/pose walkleft \r"
 
 "sel"	"/select "  @text "\r"
 
 
 
 "u"	"/use "	 @text "\r"
 "ui"	"/useitem " @text "\r"
 "y"	"/yell "	@text "\r"
 "yh"	"/yell here! fallen \r"
 "uuu"		"/use " 	@splayer "\r"
 "uuuu" 		"/use " 	@splayer "\r"
 "unsh"		"/unshare " @splayer "\r"
 "wave"		"/action waves \r"
 "yawn"		"/action yawns.\r"
 "yybrb"		"/yell Be right back\r"
 "yye"		"/yell East\r"
 "yyn"		"/yell North\r"
 "yys"		"/yell South\r"
 "yyw"		"/yell West\r"
 "yret"		"/yell Retreat!\r"
 "yy>"		"/yell East>>>\r"
 "yy<"		"/yell <<<West\r"
 '>>>'		"East>>>"
 '<<<'		"<<<West"
 
 ArmUp
 {
 if @my.right_item != myWeapon
 	setglobal rItem @my.right_item
 	"/equip " myWeapon "\r"
 	"/options icon armed\r"
 end if
 }
 
 ArmDown
 {
 if @my.right_item == myWeapon
 	"/equip " rItem "\r"
 	"/options icon unarmed\r"
 end if
 }
 
 
 // modeVerbose is a global variable intended to be included in macros
 // that have actions attached to them. place a test reading:
 // "if modeVerbose == 1" before the actions
 
 //non-optimized to add: message Variable and call Instruction
 
 "/set"
 {
 
 if @text.word[0] == "?"
 
 	message "***The following variables are available to set using this command:"
 	pause 5
 	message "*verbose [0|1|?], longsleep [on|off|?]"
 	pause 5
 
 	message "*clock, bag [(number)], maxbag (number), wh(isper) [on|off], debug [on|1|off|0]"
 	pause 5
 	message "*feedback [on|1|off|0], tgn [number],* F1-2: pull/push, F5: chain "
 
 pause 5
 
 message "*[ranger] tr <name>,* escape: shieldstone, F4:heartwood,F11: sky bison "
 	message "***End Help***"
 
 else if @text.word[0] == "verbose"
 	if @text.word[1] == "?"
 		message "* This variable sets whether or not to associate an \"/action\" or \"/narrate\" with a macro."
 		pause 20
 		message "\"1\" is on, \"0\" is off."
 		if modeVerbose == 0
 			message "*Verbose mode is off."
 		else
 			message "*Verbose mode is on."
 		end if
 	else
 		if @text.word[1] == 1
 			setglobal modeVerbose @text.word[1]
 		else if @text.word[1] == 0
 			setglobal modeVerbose @text.word[1]
 		else if @text.word[1] == "on"
 			setglobal modeVerbose 1
 		else if @text.word[1] == "off"
 			setglobal modeVerbose 0
 		else
 			message "Error: Verbose Mode must be set to 0|off|1|on."
 			goto end
 		end if
 
 		if modeVerbose == "1"
 			message "*Verbose mode: On."
 		else if modeVerbose == "0"
 			message "*Verbose mode: Off."
 		end if
 	end if
 else if @text.word[0] == "debug"
 	if @text.word[1] == "?"
 		message "*This variable sets whether debugger messages are displayed when testing a macro."
 		pause 15
 		if debug == 0
 			message "*debug is off."
 		else
 			message "*debug mode is on."
 		end if
 	else if @text.word[1] == 1
 		setglobal debug @text.word[1]
 	else if @text.word[1] == 0
 		setglobal debug @text.word[1]
 	else if @text.word[1] == "on"
 		setglobal debug 1
 	else if @text.word[1] == "off"
 		setglobal debug 0
 	else
 		message "Error: Debug Mode must be set to 0 or 1, or off and on."
 		goto end
 	end if
 	message "debug is set to: " debug
 else if @text.word[0] == "longsleep"
 	if @text.word[1] == "?"
 		message "*This variable is used to toggle the long sleep macro \"on\" and \"off\"."
 		if longsleep == 0
 			message "*longsleep is off."
 		else
 			message "*longsleep is on."
 		end if
 	else if @text.word[1] == "off"
 		setglobal longsleep 0
 		message "*longsleep is off."
 	else if @text.word[1] == "on"
 		setglobal longsleep 1
 		message "*longsleep is on."
 	else if if @text.word[1] == 0
 		setglobal longsleep 0
 		message "*longsleep is off."
 	else if if @text.word[1] == 1
 		setglobal longsleep 1
 		message "*longsleep is on."
 	end if
 else if @text.word[0] == "bag"
 	if @text.word[1] == "?"
 		message "*This variable is used to select a bag number to use for kudzu planting."
 		message "the current bag is " bag_number "."
 	end if
 	if @text.word[1] > 0
 		setglobal bag_number @text.word[1]
 		"/selectitem \"bag of kudzu seedlings <#" bag_number "\"\r"
 		message "the current bag is " bag_number "."
 	end if
 else if @text.word[0] == "maxbag"
 	if @text.word[1] == "?"
 		message "*This variable is used to set how many kudzu bags you have on you."
 		message "the number of kudzu bags is " max_bag "."
 	end if
 	if @text.word[1] > 0
 		setglobal max_bag @text.word[1]
 		message "you number of kudzu bags is set at " max_bag "."
 	end if
 else if @text.word[0] == "feedback"
 	if @text.word[1] == "?"
 		message "*This variable sets whether some macros give feedback as to their status."
 		pause 15
 		if feedback == 0
 			message "*feedback is off."
 		else
 			message "*feedback is on."
 		end if
 	else if @text.word[1] == 1
 		setglobal feedback @text.word[1]
 	else if @text.word[1] == 0
 		setglobal feedback @text.word[1]
 	else if @text.word[1] == "on"
 		setglobal feedback 1
 	else if @text.word[1] == "off"
 		setglobal feedback 0
 	else
 		message "Error: Debug Mode must be set to 0 or 1, or off and on."
 		goto end
 	end if
 	message "feedback is set to: " feedback
 else if @text.word[0] == "tgn"
 	if @text.word[1] == ""
 		setglobal thankTarget 1
 	else
 		setglobal thankTarget @text.word[1]
 	end if
 	call WhoAmIThanking
 else
 	setglobal @text.word[0] @text.word[1]
 	message @text.word[0] " is " @text.word[1]
 end if
 label end
 }
 
 include "RC2.txt"

Revisions

  • v1.0 2008012x-inu: posted.
  • v1.1 20080128-inu: Fixed errors
  • v2.0 20080128-inu: Revamped to remove excessive idle pause and integrate Raul's Trainer messages. Also by removing excessive pause in integrated DHAwakeAFK part of scanner, eliminated one way fogginess (where everything keeps moving except you).
  • v2.1 20080129-inu: Added recommended movement of Raul's readtext.mac back to separate file while still integrating into the main scanner loop via a call as recommended by ?.
  • v2.1.1 20080129-inu: Added pie-o-matic global default pie target variable. Fixed ExilePicker to exclude currently clanning character.

Links