ThankGroup: Difference between revisions
From CLUMP
Jump to navigationJump to search
Created page with " /*----------------------------------------------------------------------------- | shareMultiple Version 1.0.1 | ThankGroup Version 2.1.5 | ---------------------------..." |
No edit summary |
||
| Line 1: | Line 1: | ||
/*----------------------------------------------------------------------------- | /*----------------------------------------------------------------------------- | ||
| shareMultiple Version 1.0.1 | ThankGroup Version 2.1.5 | | |||
--------------------------------- Description --------------------------------- | --------------------------------- Description --------------------------------- | ||
Shares is | Shares.txt is a replacement of the default /share command to accept multiple names, to speed sharing and thanking groups of people. | ||
This macro allows making a list of people to thank in one command "sh <name*> <name> {etc.} " You can call AutoThank ("/ath by default") if you want to automatically thank a person every 5 minutes (set w/"delay" global: default 1200 Frames). | |||
The Default Triggers are listed below, feel free to edit them. A short description is listed next to each trigger. | |||
----------------------------------- Usage ------------------------------------- | ----------------------------------- Usage ------------------------------------- | ||
*type "/th?" for online help | |||
type: | |||
sh [name*] [name] [name] [name] [name] | "sh [name*] [name] [name] [name] [name]" | ||
to share up to | to share up to your maximum number of people. | ||
*You can type partial names as you can with the default share command. | type: | ||
"/tn" to start thanking people on the list | |||
*You can type partial names as you can with the default share command. Do not use spaces for exiles with two word names. (i.e. Elenis Reyav could be "Elenis", "ElenisReyav" or even "Elen" if there is no other "elen*" on. | |||
----------------------------------- Setup ------------------------------------- | ----------------------------------- Setup ------------------------------------- | ||
Note: to work properly you might have to remove the | (1)Add the line below to your default macro file: | ||
include "Shares.txt" | |||
*New users and Windows users see http://www.clanlord.net/clump/index.php?title=Installing_Macros | |||
for detailed install instructions and caveats | |||
(2) Note: to work properly you might have to remove the default share shortcut | |||
"sh" "/share " @text "\r" | |||
from your default macros file. | |||
(2b)Or you can use other built in triggers: | |||
"shm" & "/shm" | |||
-------------------------------- Feedback/Info -------------------------------- | -------------------------------- Feedback/Info -------------------------------- | ||
*ThankRandom will clear your thank list with "new" and append people to the random pool with "add" So "/thr new" or "/thr add" modifies the list, while just the default "/thr" thanks someone in the list without altering it. | *ThankRandom will clear your thank list with "new" and append people to the random pool with "add" So "/thr new" or "/thr add" modifies the list, while just the default "/thr" thanks someone in the list without altering it. | ||
**Thank Options controls several options. including just a number ("/tho 3") will set the person at that position in the list (3 in this case) as the next exile to thank. With "/tho debug #" set to 0 or 1 it will allow debug messages to show up and allow you to load a default list of people to thank into the ThankGroup by activating the default share shortcut,"sh", which you can set in the listA global below. With the "off" option ("/tho off") it turns off the AutoThank loop. | |||
** Thank Options controls several options. including just a number ("/tho 3") will set the person at that position in the list (3 in this case) as the next exile to thank. With "debug" set to 0 or 1 it will allow debug messages to show up and allow you to load a default list of people to thank into the ThankGroup by activating the default share shortcut,"sh", which you can set in listA below. With the "off" option ("/tho off") it turns off the AutoThank loop. | This macro could be written better if it wasn't a collection of separate macros at one point... | ||
If you find any bugs or have suggestions, contact noivad either in game or | |||
at his mac dot com address. This macro is "/Thank-ware." | |||
------------------------------ Macro Geek Info ------------------------------ | |||
*The v.2.1.3 comment format is as follows: | *The v.2.1.3 comment format is as follows: | ||
<<m_macroname>> (default trigger|s <required text> [optional text]) short description. | <<m_macroname>> (default trigger|s <required text> [optional text]) short description. | ||
** the single less than some text and greater than denotes strings so when you see "/thg [message] | ** the single less than some text and greater than denotes strings so when you see "/thg [message]" | ||
** the vertical bar "|" is used to denote valid options (arguments) th macro accepts | ** the vertical bar "|" is used to denote valid options (arguments) th macro accepts | ||
** all macros are prefixed with "m_" in the file for quick searching and avoiding false hits from "call <macro>" | ** all macros are prefixed with "m_" in the file for quick searching and avoiding false hits from "call <macro>" | ||
** global variable have their type & [:specific function] in techspeak along with a short description | ** global variable have their type & [:specific function] in techspeak along with a short description | ||
---------------------- Version Notes (for Macro Geeks) ---------------------- | |||
v.2.1.2 "ThankRandom" was added by request of Rroot | |||
v.2.1.3 *fixed a small bug that threw an error, but didn't stop the macro | |||
v. 2.1.2 "ThankRandom" was added by request of Rroot | |||
v.2.1.3 *fixed a small bug that threw | |||
*Added <<tags>> to functions and comments | *Added <<tags>> to functions and comments | ||
*Added ThankHelp macro | *Added ThankHelp macro | ||
v.2.1.4 Added ability to remove a person from the list with /thgc <number> | v.2.1.4 Added ability to remove a person from the list with /thgc <number> | ||
*Added ThankGroup Help "/thh" or "/thgh" | *Added ThankGroup Help "/thh" or "/thgh" | ||
-----------------------------------------------------------------------------*/ | v.2.1.5 Fixed bugs that tried to thank after thankList end | ||
*Fixed bugs that did not advance the thankTarget pointer when no karma was available | |||
or the person was not online | |||
*Added automatic clearing of people not online from thankList using /thgc | |||
*Added getThankTotal function to display thankTotal at end of /thg? | |||
----------------------------------------------------------------------------- */ | |||
/****** Share Triggers ******/ | /****** Share Triggers ******/ | ||
"sh" call shareMultiList //changes /share to add multiple people | "sh" call shareMultiList //changes /share to add multiple people | ||
"/shm" call shareMultiList // also adds to myTG | "/shm" call shareMultiList // also adds to myTG | ||
"shm" call shareMultiList //{{m_shareMultiList}} | "shm" call shareMultiList //{{m_shareMultiList}} | ||
/****** Thank Group Triggers ******/ | /****** Thank Group Triggers ******/ | ||
"/th?" call ThankHelp //Online ThankGroup command help | "/th?" call ThankHelp //Online ThankGroup command help | ||
| Line 61: | Line 63: | ||
"/thgc" call ClearThankGroup //Clears out ThankGroup | "/thgc" call ClearThankGroup //Clears out ThankGroup | ||
"/thgh" call ThankHelp //Online ThankGroup command help | "/thgh" call ThankHelp //Online ThankGroup command help | ||
"/thgn" call ThankOptions //Sets | "/thgn" call ThankOptions //Sets options including number | ||
"/thh" call ThankHelp //Online ThankGroup command help | "/thh" call ThankHelp //Online ThankGroup command help | ||
"/thn" call ThankNext // Thanks next person in the list | "/thn" call ThankNext // Thanks next person in the list | ||
"/tho" call ThankOptions // see ** Above or {{m_ThankOptions}} below | "/tho" call ThankOptions // see ** Above or {{m_ThankOptions}} below | ||
"/thr" call ThankRandom // See * Above | "/thr" call ThankRandom // See * Above | ||
"/ths" call ThankSharers //loads | "/ths" call ThankSharers //loads people sharing you into thank list | ||
"/tn" call ThankNext //Thanks the next person on list | "/tn" call ThankNext //Thanks the next person on list | ||
/*Edit this list with to up to 5 exiles you like to share with automatically. Do Not include spaces. Note will only work with debug = 1 set with ThankOptions "/tho debug 1" */ | |||
set debug 0 //<<debug>> (bool:toggle) turns on and off debugging | set debug 0 //<<debug>> (bool:toggle) turns on and off debugging | ||
set theMessage " Thank you " //<<EditMe>> your default message | set theMessage " Thank you " //<<EditMe>> your default message | ||
set myThankGroup[0] "" //<<EditMe>> to initialize <myTG> | set myThankGroup[0] "" //<<EditMe>> to initialize <myTG> | ||
set listA "Noivad Creed Thoomilicious Kalian Geotzou Stora Taryn" //edit this to your friends | |||
/* -------- Do not Edit below this line if not Familiar with Macros -------- */ | /* -------- Do not Edit below this line if not Familiar with Macros -------- */ | ||
set slotG 1 //<<slotG>> (int:index) is the pointer for the list | set slotG 1 //<<slotG>> (int:index) is the pointer for the list | ||
set currentIndex 0 | set currentIndex 0 | ||
set thankTotal 1 //<<thankTotal>> (int:sum) <<!=DO_NOT_EDIT>> {?}Number in list | set thankTotal 1 //<<thankTotal>> (int:sum) <<!=DO_NOT_EDIT>> {?}Number in list | ||
//myThankGroup <<myTG>> (arr) list of exiles to thank | //!myThankGroup <<myTG>> (arr) list of exiles to thank | ||
set thankTarget 1 | set thankTarget 1 | ||
set ATH 0 //<<ATH>> (bool:toggle) controls automatic thanking | set ATH 0 //<<ATH>> (bool:toggle) controls automatic thanking | ||
| Line 86: | Line 86: | ||
set ent 0 | set ent 0 | ||
set initSwitch 0 | set initSwitch 0 | ||
set clearThisOne 0 | |||
/* ************************** shareMultiple v1.0.1 ************************** */ | /* ************************** shareMultiple v1.0.1 ************************** */ | ||
//<<m_shareMultiList>> (sh|/shm|shm <name> [name]) shares & adds to list | //<<m_shareMultiList>> (sh|/shm|shm <name> [name]) shares & adds to list | ||
shareMultiList | shareMultiList | ||
| Line 93: | Line 93: | ||
setglobal ht[sh] "*'sh|/shm|shm <name> [name]' shares & adds exiles to list (i.e. 'sh Creed ElenisReyav Var Talin Lorikeet')" | setglobal ht[sh] "*'sh|/shm|shm <name> [name]' shares & adds exiles to list (i.e. 'sh Creed ElenisReyav Var Talin Lorikeet')" | ||
setglobal ht[1] "*'sh|/shm|shm <name> [name]' shares & adds exiles to list (i.e. 'sh Creed ElenisReyav Var Talin Lorikeet')" | setglobal ht[1] "*'sh|/shm|shm <name> [name]' shares & adds exiles to list (i.e. 'sh Creed ElenisReyav Var Talin Lorikeet')" | ||
if initSwitch == 1 | if initSwitch == 1 | ||
goto END | goto END | ||
| Line 122: | Line 121: | ||
label END | label END | ||
} | } | ||
/***************************** Thank Group v2.1.3 *****************************/ | /***************************** Thank Group v2.1.3 *****************************/ | ||
//<<m_ThankGroup>> (/thg [message]) Thanks exile|s in list (activates AutoThank) | //<<m_ThankGroup>> (/thg [message]) Thanks exile|s in list (activates AutoThank) | ||
ThankGroup | ThankGroup | ||
| Line 133: | Line 130: | ||
goto END | goto END | ||
end if | end if | ||
if @text == "reset" | if @text == "reset" | ||
call ClearThankGroup | call ClearThankGroup | ||
| Line 141: | Line 137: | ||
goto END | goto END | ||
else if @text == ? | else if @text == ? | ||
message thga | |||
else | else | ||
if @text != "" | if @text != "" | ||
| Line 152: | Line 148: | ||
label END | label END | ||
} | } | ||
//<<m_AddToThankGroup>> (/thga <name> [name]) adds exile|s to list | //<<m_AddToThankGroup>> (/thga <name> [name]) adds exile|s to list | ||
/*To do: add gorvin's scanned for if a person is already on the list to the macro. (Gorvin gave permission on 20120325 during Crypt hunt: Thanks G!)*/ | /*To do: add gorvin's scanned for if a person is already on the list to the macro. (Gorvin gave permission on 20120325 during Crypt hunt: Thanks G!)*/ | ||
| Line 166: | Line 161: | ||
if debug == 1 | if debug == 1 | ||
message "slotG=" slotG | message "slotG=" slotG | ||
end if | |||
if @text == ? | |||
message ht[thga] | |||
end if | |||
label addloop | |||
if slot < num_people //#number of people listed in sh | |||
setglobal myThankGroup[slotG] @text.word[slot] | setglobal myThankGroup[slotG] @text.word[slot] | ||
if debug == 1 | if debug == 1 | ||
| Line 181: | Line 176: | ||
setglobal slotG + 1 | setglobal slotG + 1 | ||
goto addloop | goto addloop | ||
end if | |||
//if modeverbose == 1 | |||
call WhoAmIThanking | call WhoAmIThanking | ||
//end if | |||
label END | label END | ||
} | } | ||
//<<m_ClearThankGroup>> (/thgc) clears and resets list | //<<m_ClearThankGroup>> (/thgc) clears and resets list | ||
ClearThankGroup | ClearThankGroup | ||
| Line 196: | Line 190: | ||
goto END | goto END | ||
end if | end if | ||
if @text == "" | if clearThisOne == 1 | ||
call moveUp | |||
setglobal clearOne 0 | |||
else if @text == "" | |||
message "Clearing thank group" | message "Clearing thank group" | ||
setglobal thankTarget 0 | setglobal thankTarget 0 | ||
| Line 202: | Line 199: | ||
setglobal thankTotal 1 | setglobal thankTotal 1 | ||
setglobal myThankGroup "" | setglobal myThankGroup "" | ||
setglobal slotG | setglobal slotG 1 | ||
message thankTarget "*" counted "*" thankTotal "*" myThankGroup "*" slotG "*" | message thankTarget "*" counted "*" thankTotal "*" myThankGroup "*" slotG "*" | ||
else if @text == 0 | else if @text == 0 | ||
| Line 215: | Line 212: | ||
label END | label END | ||
} | } | ||
//Internal Function Decrements thankGroup[pointer] | |||
targetMinus | |||
{ | |||
setglobal thankTarget - 1 | |||
pause 1 | |||
if thankTarget == 0 | |||
setglobal thankTarget 1 | |||
end if | |||
} | |||
//Internal Function Advances thankGroup[pointer] | |||
targetPlus | |||
{ | |||
setglobal thankTarget + 1 | |||
pause 1 | |||
if thankTarget > thankTotal | |||
setglobal thankTarget 1 | |||
end if | |||
} | |||
//<<m_ThankNext>> (/tn [message]) actually does the thanking | //<<m_ThankNext>> (/tn [message]) actually does the thanking | ||
ThankNext | ThankNext | ||
{ | { | ||
if initSwitch == 1 | if initSwitch == 1 | ||
setglobal ht[3] "/tn [message]' manually thanks the next person and sets the message" | setglobal ht[3] "'/tn [message]' manually thanks the next person and sets the message" | ||
setglobal ht[tn] "'/tn [message]' manually thanks the next person and sets the message" | |||
goto END | goto END | ||
end if | end if | ||
if @text == "" | if @text == "" | ||
"/thank " myThankGroup[thankTarget] " " theMessage " " myThankGroup[thankTarget] " :)\r" | "/thank " myThankGroup[thankTarget] " " theMessage " " myThankGroup[thankTarget] " :)\r" | ||
| Line 230: | Line 244: | ||
end if | end if | ||
pause 1 | pause 1 | ||
set tocheck | set tocheck @env.TextLog | ||
//message tocheck | //message tocheck these delegate incrementing next thank to targetMinus & targetPlus | ||
if tocheck < "You have no karma to give | if tocheck < "You have no karma to give" | ||
pause 1 | |||
if debug == 1 | if debug == 1 | ||
message "*Unable to give | message "* Unable to give karma to " myThankGroup[thankTarget] " holding place." | ||
end if | end if | ||
else if tocheck < " | else if tocheck < "is not in the lands" | ||
if debug == 1 | if debug == 1 | ||
message "*Unable to give kamra (No Target) holding place." | message "*Unable to give kamra (No Target) holding place." | ||
end if | end if | ||
setglobal clearThisOne 1 | |||
setglobal currentIndex thankTarget | |||
call ClearThankGroup | |||
setglobal clearOne 0 | |||
else if tocheck < "You gave signed " | |||
pause 1 | |||
if debug == 1 | |||
message "The next person to be thanked is " myThankGroup[thankTarget] | |||
end if | |||
call targetPlus | |||
else if tocheck < " is too far away for your explanation." | |||
pause 1 | |||
if debug == 1 | |||
message "The next person to be thanked is " myThankGroup[thankTarget] | |||
end if | |||
call targetPlus | |||
else if tocheck < "myThankGroup[thankTarget]" | else if tocheck < "myThankGroup[thankTarget]" | ||
call targetPlus | |||
else | else | ||
call targetPlus | |||
end if | end if | ||
label END | label END | ||
} | } | ||
WhoAmIThanking //<<m_WhoAmIThanking>> (/thgwho)|(/thg?) outputs the myTG | WhoAmIThanking //<<m_WhoAmIThanking>> (/thgwho)|(/thg?) outputs the myTG | ||
{ | { | ||
| Line 273: | Line 293: | ||
goto END | goto END | ||
else | else | ||
message " | message "*My thank group is currently: " | ||
setglobal counted | setglobal counted 1 | ||
set thankTotalAdjustment thankTotal | set thankTotalAdjustment thankTotal | ||
//set thankTotalAdjustment - 1 | //set thankTotalAdjustment - 1 | ||
| Line 289: | Line 309: | ||
end if | end if | ||
label END | label END | ||
call getThankTotal | |||
} | } | ||
ThankSharers // (/ths) adds all people sharing you to the list | ThankSharers // (/ths) adds all people sharing you to the list | ||
{ | { | ||
if initSwitch == 1 | if initSwitch == 1 | ||
setglobal ht[ths] "'/ths' adds all people sharing you to the list" | setglobal ht[ths] "'/ths' adds all people sharing you to the list" | ||
goto END | goto END | ||
end if | end if | ||
| Line 302: | Line 322: | ||
message "Thank Share In Number =" @my.shares_in.num_words | message "Thank Share In Number =" @my.shares_in.num_words | ||
end if | end if | ||
label LOOP0 | label LOOP0 | ||
if number == @my.shares_in.num_words | if number == @my.shares_in.num_words | ||
| Line 313: | Line 332: | ||
goto LOOP0 | goto LOOP0 | ||
end if | end if | ||
label END | label END | ||
if debug == 1 | if debug == 1 | ||
| Line 320: | Line 338: | ||
label END | label END | ||
} | } | ||
//<<m_ThankRandom>> ["restore"|clears("new")|("add")] myTG & thanks a random person sharing | //<<m_ThankRandom>> ["restore"|clears("new")|("add")] myTG & thanks a random person sharing | ||
ThankRandom | ThankRandom | ||
| Line 344: | Line 361: | ||
end if | end if | ||
end if | end if | ||
set randomNum @random | set randomNum @random | ||
setglobal thankTarget randomNum | set randomNum % thankTotal | ||
if thankTarget == randomNum | |||
message "*NUMMATCH" | |||
else | |||
setglobal thankTarget randomNum | |||
end if | |||
call ThankNext | call ThankNext | ||
setglobal thankTarget thankSave //resets the thank index | setglobal thankTarget thankSave //resets the thank index | ||
label END | label END | ||
} | } | ||
//<<m_ThankOptions>> (/tho) sets Target to 0|number or switches debugging on | |||
//<<m_ThankOptions>> (/tho) sets | |||
ThankOptions | ThankOptions | ||
{ | { | ||
| Line 381: | Line 401: | ||
end if | end if | ||
else | else | ||
message "*That number won't work. The highest number you can set it currently: " | message "*That number won't work. The highest number you can set it currently: " thankTotal | ||
pause 7 | pause 7 | ||
message "*Blame Polerand! ;)" | message "*Blame Polerand! ;)" | ||
| Line 388: | Line 408: | ||
set words @text.word[count] | set words @text.word[count] | ||
set counter 1 | set counter 1 | ||
set interim "" | |||
label MESSAGEBUILDER | label MESSAGEBUILDER | ||
if counter > words | if counter > words | ||
| Line 393: | Line 414: | ||
message "the message is now: " theMessage | message "the message is now: " theMessage | ||
else | else | ||
set interim.word[counter] @text.word[counter] " " | set interim.word[counter] + @text.word[counter] " " | ||
set counter + 1 | set counter + 1 | ||
goto MESSAGEBUILDER | goto MESSAGEBUILDER | ||
| Line 400: | Line 421: | ||
label END | label END | ||
} | } | ||
// AutoThank 1.0 "/ath" | // AutoThank 1.0 "/ath" | ||
AutoThank //<<m_AutoThank>> (/ath ["0"|"off"]) turns on*|off automatic thanks | AutoThank //<<m_AutoThank>> (/ath ["0"|"off"]) turns on*|off automatic thanks | ||
{ | { | ||
| Line 419: | Line 438: | ||
end if | end if | ||
setglobal ATH 1 | setglobal ATH 1 | ||
label LOOPA | label LOOPA | ||
if ATH == 1 | if ATH == 1 | ||
| Line 427: | Line 445: | ||
goto LOOPA | goto LOOPA | ||
else | else | ||
if thankTarget != 1 | |||
setglobal thankTarget 1 | |||
end if | |||
message "***You are out of people to thank.***" | message "***You are out of people to thank.***" | ||
message "***To Add more type /thga <name> [name] ..." | message "***To Add more type /thga <name> [name] ..." | ||
end if | end if | ||
end if | end if | ||
label ENDoff | label ENDoff | ||
message "*AutoThank is Off" | message "*AutoThank is Off" | ||
label END | label END | ||
} | } | ||
//<<m_BuildDefault>> List Building Function | //<<m_BuildDefault>> List Building Function | ||
BuildDefault | BuildDefault | ||
| Line 445: | Line 464: | ||
end if | end if | ||
label LOOPA | label LOOPA | ||
if count | if count <= listA.num_words | ||
setglobal myThankGroup[slotG] listA.word[count] | setglobal myThankGroup[slotG] listA.word[count] | ||
if debug == 1 | if debug == 1 | ||
| Line 456: | Line 475: | ||
pause 20 | pause 20 | ||
goto LOOPA | goto LOOPA | ||
end if | |||
if debug == 1 | |||
message "* Default thank group finished building *" | |||
end if | end if | ||
label END | label END | ||
} | } | ||
// <<m_moveUp>> Reorganizes the thankgroup List triggered by ClearThankGroup | |||
// <<m_moveUp>> Reorganizes the thankgroup List | |||
moveUp | moveUp | ||
{ | { | ||
| Line 473: | Line 494: | ||
setglobal slotG - 1 | setglobal slotG - 1 | ||
setglobal thankTotal - 1 | setglobal thankTotal - 1 | ||
if thankTotal < 1 | |||
setglobal thankTotal 0 | |||
end if | |||
else | else | ||
setglobal myThankGroup[currentIndex] myThankGroup[cIndexPlus] | setglobal myThankGroup[currentIndex] myThankGroup[cIndexPlus] | ||
| Line 512: | Line 536: | ||
else if @text == "thgc" | else if @text == "thgc" | ||
message ht[4] | message ht[4] | ||
else if @text == "tn" | |||
message ht[tn] | |||
else if @text == "th?" | else if @text == "th?" | ||
message "*Now you're done it!*" | |||
pause 4 | |||
message "*************************" | message "*************************" | ||
message "*Universal Self Destruct Activated*" | message "*Universal Self Destruct Activated*" | ||
message "*************************" | message "*************************" | ||
message "*10..." | message "*10..." | ||
pause 2 | pause 2 | ||
message "*9..." | message "*9..." | ||
| Line 539: | Line 565: | ||
pause 4 | pause 4 | ||
message "*0" | message "*0" | ||
pause 2 | |||
message "*BOOM!*" | message "*BOOM!*" | ||
else | else | ||
message ht[ent] | message ht[ent] | ||
end if | end if | ||
| Line 551: | Line 577: | ||
label END | label END | ||
} | } | ||
InitThG | InitThG | ||
{ | { | ||
| Line 567: | Line 592: | ||
end if | end if | ||
setglobal initSwitch 0 | setglobal initSwitch 0 | ||
} | |||
getThankTotal | |||
{ | |||
set thankTMod thankTotal | |||
set thankTMod - 1 | |||
message "thankTotal is " thankTMod | |||
message "thankTarget is" thankTarget | |||
} | } | ||
Revision as of 20:09, 6 December 2013
/*-----------------------------------------------------------------------------
| shareMultiple Version 1.0.1 | ThankGroup Version 2.1.5 |
--------------------------------- Description ---------------------------------
Shares.txt is a replacement of the default /share command to accept multiple names, to speed sharing and thanking groups of people.
This macro allows making a list of people to thank in one command "sh <name*> <name> {etc.} " You can call AutoThank ("/ath by default") if you want to automatically thank a person every 5 minutes (set w/"delay" global: default 1200 Frames).
The Default Triggers are listed below, feel free to edit them. A short description is listed next to each trigger.
----------------------------------- Usage -------------------------------------
*type "/th?" for online help
type:
"sh [name*] [name] [name] [name] [name]"
to share up to your maximum number of people.
type:
"/tn" to start thanking people on the list
*You can type partial names as you can with the default share command. Do not use spaces for exiles with two word names. (i.e. Elenis Reyav could be "Elenis", "ElenisReyav" or even "Elen" if there is no other "elen*" on.
----------------------------------- Setup -------------------------------------
(1)Add the line below to your default macro file:
include "Shares.txt"
*New users and Windows users see http://www.clanlord.net/clump/index.php?title=Installing_Macros
for detailed install instructions and caveats
(2) Note: to work properly you might have to remove the default share shortcut
"sh" "/share " @text "\r"
from your default macros file.
(2b)Or you can use other built in triggers:
"shm" & "/shm"
-------------------------------- Feedback/Info --------------------------------
*ThankRandom will clear your thank list with "new" and append people to the random pool with "add" So "/thr new" or "/thr add" modifies the list, while just the default "/thr" thanks someone in the list without altering it.
**Thank Options controls several options. including just a number ("/tho 3") will set the person at that position in the list (3 in this case) as the next exile to thank. With "/tho debug #" set to 0 or 1 it will allow debug messages to show up and allow you to load a default list of people to thank into the ThankGroup by activating the default share shortcut,"sh", which you can set in the listA global below. With the "off" option ("/tho off") it turns off the AutoThank loop.
This macro could be written better if it wasn't a collection of separate macros at one point...
If you find any bugs or have suggestions, contact noivad either in game or
at his mac dot com address. This macro is "/Thank-ware."
------------------------------ Macro Geek Info ------------------------------
*The v.2.1.3 comment format is as follows:
<<m_macroname>> (default trigger|s <required text> [optional text]) short description.
** the single less than some text and greater than denotes strings so when you see "/thg [message]"
** the vertical bar "|" is used to denote valid options (arguments) th macro accepts
** all macros are prefixed with "m_" in the file for quick searching and avoiding false hits from "call <macro>"
** global variable have their type & [:specific function] in techspeak along with a short description
---------------------- Version Notes (for Macro Geeks) ----------------------
v.2.1.2 "ThankRandom" was added by request of Rroot
v.2.1.3 *fixed a small bug that threw an error, but didn't stop the macro
*Added <<tags>> to functions and comments
*Added ThankHelp macro
v.2.1.4 Added ability to remove a person from the list with /thgc <number>
*Added ThankGroup Help "/thh" or "/thgh"
v.2.1.5 Fixed bugs that tried to thank after thankList end
*Fixed bugs that did not advance the thankTarget pointer when no karma was available
or the person was not online
*Added automatic clearing of people not online from thankList using /thgc
*Added getThankTotal function to display thankTotal at end of /thg?
----------------------------------------------------------------------------- */
/****** Share Triggers ******/
"sh" call shareMultiList //changes /share to add multiple people
"/shm" call shareMultiList // also adds to myTG
"shm" call shareMultiList //Template:M shareMultiList
/****** Thank Group Triggers ******/
"/th?" call ThankHelp //Online ThankGroup command help
"/ath" call AutoThank //Starts an Automatic thank loop | "off" to stop
"/thb" call BuildDefault //Builds the default or saved list
"/thg" call ThankGroup //Thanks the next person on the list
"/thga" call AddToThankGroup // Adds a person to ThankGroup list
"/thgwho" call WhoAmIThanking // Shows the ThankGroup list
"/thg?" call WhoAmIThanking // "
"/thgc" call ClearThankGroup //Clears out ThankGroup
"/thgh" call ThankHelp //Online ThankGroup command help
"/thgn" call ThankOptions //Sets options including number
"/thh" call ThankHelp //Online ThankGroup command help
"/thn" call ThankNext // Thanks next person in the list
"/tho" call ThankOptions // see ** Above or Template:M ThankOptions below
"/thr" call ThankRandom // See * Above
"/ths" call ThankSharers //loads people sharing you into thank list
"/tn" call ThankNext //Thanks the next person on list
/*Edit this list with to up to 5 exiles you like to share with automatically. Do Not include spaces. Note will only work with debug = 1 set with ThankOptions "/tho debug 1" */
set debug 0 //<<debug>> (bool:toggle) turns on and off debugging
set theMessage " Thank you " //<<EditMe>> your default message
set myThankGroup[0] "" //<<EditMe>> to initialize <myTG>
set listA "Noivad Creed Thoomilicious Kalian Geotzou Stora Taryn" //edit this to your friends
/* -------- Do not Edit below this line if not Familiar with Macros -------- */
set slotG 1 //<<slotG>> (int:index) is the pointer for the list
set currentIndex 0
set thankTotal 1 //<<thankTotal>> (int:sum) <<!=DO_NOT_EDIT>> {?}Number in list
//!myThankGroup <<myTG>> (arr) list of exiles to thank
set thankTarget 1
set ATH 0 //<<ATH>> (bool:toggle) controls automatic thanking
set delay 1201 //<<delay>> (int:timer) controls pause between Template:M AutoThank
set ht[0] "There is no entry here"
set ent 0
set initSwitch 0
set clearThisOne 0
/* ************************** shareMultiple v1.0.1 ************************** */
//<<m_shareMultiList>> (sh|/shm|shm <name> [name]) shares & adds to list
shareMultiList
{
setglobal ht[sh] "*'sh|/shm|shm <name> [name]' shares & adds exiles to list (i.e. 'sh Creed ElenisReyav Var Talin Lorikeet')"
setglobal ht[1] "*'sh|/shm|shm <name> [name]' shares & adds exiles to list (i.e. 'sh Creed ElenisReyav Var Talin Lorikeet')"
if initSwitch == 1
goto END
end if
setglobal count 0
if debug == 1
pause 2
message "Loading Friend Online"
call BuildDefault
else if @text == ""
"/share\r"
else
label LOOPB
if count < @text.num_words
"/share " @text.word[count] "\r"
setglobal myThankGroup[slotG] @text.word[count]
if debug == 1
pause 1
message "*" myThankGroup[slotG] " added to thankgroup."
end if
set count + 1
setglobal slotG + 1
setglobal thankTotal + 1
pause 20
goto LOOPB
end if
end if
label END
}
/***************************** Thank Group v2.1.3 *****************************/
//<<m_ThankGroup>> (/thg [message]) Thanks exile|s in list (activates AutoThank)
ThankGroup
{
setglobal ht[thg] "'/thg [message]' Sets the default message & activates AutoThank (i.e '/thg thanks for the hunt!'). '/thg /reset' clears the list."
setglobal ht[2] "'/thg [message]' Sets the default message & activates AutoThank (i.e '/thg thanks for the hunt!'). '/thg /reset' clears the list."
if initSwitch == 1
goto END
end if
if @text == "reset"
call ClearThankGroup
goto END
else if @text == "/reset"
call ClearThankGroup
goto END
else if @text == ?
message thga
else
if @text != ""
setglobal theMessage @text
end if
end if
pause 1
call AutoThank
message ending thanks
label END
}
//<<m_AddToThankGroup>> (/thga <name> [name]) adds exile|s to list
/*To do: add gorvin's scanned for if a person is already on the list to the macro. (Gorvin gave permission on 20120325 during Crypt hunt: Thanks G!)*/
AddToThankGroup
{
setglobal ht[thga] "'/thga <name> [name]' adds exile|s to list"
setglobal ht[3] "'/thga <name> [name]' adds exile|s to list"
if initSwitch == 1
goto END
end if
set num_people @text.num_words
setglobal slot 0
if debug == 1
message "slotG=" slotG
end if
if @text == ?
message ht[thga]
end if
label addloop
if slot < num_people //#number of people listed in sh
setglobal myThankGroup[slotG] @text.word[slot]
if debug == 1
message "*myThankGroup[" slotG "]=" myThankGroup[slotG]
end if
pause 1
setglobal slot + 1
setglobal thankTotal + 1
setglobal slotG + 1
goto addloop
end if
//if modeverbose == 1
call WhoAmIThanking
//end if
label END
}
//<<m_ClearThankGroup>> (/thgc) clears and resets list
ClearThankGroup
{
setglobal ht[thgc] "'/thgc [num]' clears and resets list, with a number it removes that entry in the list"
setglobal ht[4] "'/thgc [num]' clears and resets list, with a number it removes that entry in the list"
if initSwitch == 1
goto END
end if
if clearThisOne == 1
call moveUp
setglobal clearOne 0
else if @text == ""
message "Clearing thank group"
setglobal thankTarget 0
setglobal counted 0
setglobal thankTotal 1
setglobal myThankGroup ""
setglobal slotG 1
message thankTarget "*" counted "*" thankTotal "*" myThankGroup "*" slotG "*"
else if @text == 0
setglobal currentIndex @text
call moveUp
else if @text > 0
if @text <= thankTotal
setglobal currentIndex @text
call moveUp
end if
end if
label END
}
//Internal Function Decrements thankGroup[pointer]
targetMinus
{
setglobal thankTarget - 1
pause 1
if thankTarget == 0
setglobal thankTarget 1
end if
}
//Internal Function Advances thankGroup[pointer]
targetPlus
{
setglobal thankTarget + 1
pause 1
if thankTarget > thankTotal
setglobal thankTarget 1
end if
}
//<<m_ThankNext>> (/tn [message]) actually does the thanking
ThankNext
{
if initSwitch == 1
setglobal ht[3] "'/tn [message]' manually thanks the next person and sets the message"
setglobal ht[tn] "'/tn [message]' manually thanks the next person and sets the message"
goto END
end if
if @text == ""
"/thank " myThankGroup[thankTarget] " " theMessage " " myThankGroup[thankTarget] " :)\r"
else
"/thank " myThankGroup[thankTarget] " " @text "\r"
end if
pause 1
set tocheck @env.TextLog
//message tocheck these delegate incrementing next thank to targetMinus & targetPlus
if tocheck < "You have no karma to give"
pause 1
if debug == 1
message "* Unable to give karma to " myThankGroup[thankTarget] " holding place."
end if
else if tocheck < "is not in the lands"
if debug == 1
message "*Unable to give kamra (No Target) holding place."
end if
setglobal clearThisOne 1
setglobal currentIndex thankTarget
call ClearThankGroup
setglobal clearOne 0
else if tocheck < "You gave signed "
pause 1
if debug == 1
message "The next person to be thanked is " myThankGroup[thankTarget]
end if
call targetPlus
else if tocheck < " is too far away for your explanation."
pause 1
if debug == 1
message "The next person to be thanked is " myThankGroup[thankTarget]
end if
call targetPlus
else if tocheck < "myThankGroup[thankTarget]"
call targetPlus
else
call targetPlus
end if
label END
}
WhoAmIThanking //<<m_WhoAmIThanking>> (/thgwho)|(/thg?) outputs the myTG
{
if initSwitch == 1
setglobal ht[thgwho] "'/thgwho|/thg? [reset|/reset]' shows the list or optionally resets it"
goto END
end if
if @text == "reset"
call ClearThankGroup
else if @text == "/reset"
call ClearThankGroup
end if
if thankTotal == 1
message "**The thank group is empty. Try /ths or /thga <name> [name] to add people"
goto END
else
message "*My thank group is currently: "
setglobal counted 1
set thankTotalAdjustment thankTotal
//set thankTotalAdjustment - 1
label LOOPSTART
if counted < thankTotalAdjustment
if counted == thankTarget
message "[" counted "]*" myThankGroup[counted]
else
message "[" counted "]" myThankGroup[counted]
end if
setglobal counted + 1
goto LOOPSTART
end if
end if
label END
call getThankTotal
}
ThankSharers // (/ths) adds all people sharing you to the list
{
if initSwitch == 1
setglobal ht[ths] "'/ths' adds all people sharing you to the list"
goto END
end if
set number 0
if debug == 1
message "Shares in are " @my.shares_in
message "Thank Share In Number =" @my.shares_in.num_words
end if
label LOOP0
if number == @my.shares_in.num_words
goto END
else
setglobal myThankGroup[slotG] @my.shares_in.word[number]
setglobal slotG + 1
set number + 1
setglobal thankTotal + 1
goto LOOP0
end if
label END
if debug == 1
call WhoAmIThanking
end if
label END
}
//<<m_ThankRandom>> ["restore"|clears("new")|("add")] myTG & thanks a random person sharing
ThankRandom
{
if initSwitch == 1
setglobal ht[thr] "'/thr [restore|new|add]' thanks a random person sharing you. optionally clears the list and builds a new one"
goto END
end if
if @text == "new"
setglobal thankSave thankTarget //saves the index
setglobal listA myThankGroup //saves the current list
setglobal listSave 1 //allows the list to be restored
call ClearThankGroup
call ThankSharers
else if @text == "add"
call ThankSharers
else if @text == "restore"
if listSave == 1
setglobal myThankGroup listA
else
message "*There is not list to restore"
call BuildDefault
end if
end if
set randomNum @random
set randomNum % thankTotal
if thankTarget == randomNum
message "*NUMMATCH"
else
setglobal thankTarget randomNum
end if
call ThankNext
setglobal thankTarget thankSave //resets the thank index
label END
}
//<<m_ThankOptions>> (/tho) sets Target to 0|number or switches debugging on
ThankOptions
{
if initSwitch == 1
setglobal ht[tho] "'/tho [<number>||debug 0|1||off||message <message>]' sets next person thanked to 0|<number>, switches debugging on or off, turns on or off AutoThanking, or sets a new message"
goto END
end if
if @text == ""
setglobal thankTarget 0
call WhoAmIThanking
else if @text.word[0] == "debug"
if @text.word[1] < 2
setglobal debug @text.word[1]
end if
if debug == 1
message "*Debugging is on"
else if debug == 0
message "*Debugging is off"
end if
else if @text.word[0] == "off"
setglobal ATH 0
else if @text.word[0] == "on"
call AutoThank
else
if @text.word[0] > 0
if @text.word[0] <= thankTotal
setglobal thankTarget @text.word[0]
end if
else
message "*That number won't work. The highest number you can set it currently: " thankTotal
pause 7
message "*Blame Polerand! ;)"
end if
else if @text.word[0] == "message"
set words @text.word[count]
set counter 1
set interim ""
label MESSAGEBUILDER
if counter > words
setglobal theMessage interim
message "the message is now: " theMessage
else
set interim.word[counter] + @text.word[counter] " "
set counter + 1
goto MESSAGEBUILDER
end if
end if
label END
}
// AutoThank 1.0 "/ath"
AutoThank //<<m_AutoThank>> (/ath ["0"|"off"]) turns on*|off automatic thanks
{
if initSwitch == 1
setglobal ht[ath] "'/ath [0|off]' turns off automatic thanks. With no arguments it turns it on."
goto END
end if
if @text.word[0] == "off"
setglobal ATH 0
goto ENDoff
else if @text.word[0] == "0"
setglobal ATH 0
goto ENDoff
else if @text != ""
setglobal theMessage @text
end if
setglobal ATH 1
label LOOPA
if ATH == 1
pause delay
if thankTarget < thankTotalAdjustment
call ThankNext
goto LOOPA
else
if thankTarget != 1
setglobal thankTarget 1
end if
message "***You are out of people to thank.***"
message "***To Add more type /thga <name> [name] ..."
end if
end if
label ENDoff
message "*AutoThank is Off"
label END
}
//<<m_BuildDefault>> List Building Function
BuildDefault
{
if initSwitch == 1
setglobal ht[thb] "'/thb' builds the thank list using the the default in Friends"
goto END
end if
label LOOPA
if count <= listA.num_words
setglobal myThankGroup[slotG] listA.word[count]
if debug == 1
pause 1
message "*" myThankGroup[slotG] " added to thankgroup."
end if
set count + 1
setglobal slotG + 1
setglobal thankTotal + 1
pause 20
goto LOOPA
end if
if debug == 1
message "* Default thank group finished building *"
end if
label END
}
// <<m_moveUp>> Reorganizes the thankgroup List triggered by ClearThankGroup
moveUp
{
message "**moving up"
message "*thankTotal is:" thankTotal "*"
label DECLOOP
setglobal cIndexPlus currentIndex
setglobal cIndexPlus + 1
if cIndexPlus >= thankTotal
message "**don't see any other people in list"
message "*Thanklist reorganized* type /thg? to see it"
setglobal slotG - 1
setglobal thankTotal - 1
if thankTotal < 1
setglobal thankTotal 0
end if
else
setglobal myThankGroup[currentIndex] myThankGroup[cIndexPlus]
if myThankGroup[currentIndex] == myThankGroup[cIndexPlus]
message myThankGroup[currentIndex] " is now in position " currentIndex
end if
setglobal currentIndex + 1
goto DECLOOP
end if
}
//<<m_ThankHelp>> {/thgh|/?th|/thh }Lists how to control macro
ThankHelp
{
setglobal hEntry 0
set initSwitch 1
call InitThG
if @text == "overview"
message "*ThankGroup builds a list of exiles to thank."
message "*/type '/th? quickstart' for a basic command list"
message "*The <commands> are: sh, ath, thb, thg, thga, thgc, thgwho, tho, thr, ths, tn and are preceded with a slash '/'"
message "type '/th? <command> for more info on each command"
else if @text == "quickstart"
message "*'/thga' and their names (with no spaces) to add people"
message "*'/thg' followed by any message to send to the group."
message "*'/tho' set options or sets thank number."
message "*'/thgn {number}' sets thank group number."
message "*'/tn' to thank the next person manually"
message "*'/ath 0' or '/tho off' to stop the macro"
message "*'/th? message' see what current message is"
else if @text == "message"
message "*" theMessage
else if @text != ""
if @text == "sh"
message ht[1]
else if @text == "thg"
message ht[2]
else if @text == "thgn"
message ht[3]
else if @text == "thgc"
message ht[4]
else if @text == "tn"
message ht[tn]
else if @text == "th?"
message "*Now you're done it!*"
pause 4
message "*************************"
message "*Universal Self Destruct Activated*"
message "*************************"
message "*10..."
pause 2
message "*9..."
pause 4
message "*8..."
pause 4
message "*7..."
pause 4
message "*6..."
pause 4
message "*5..."
pause 4
message "*4..."
pause 4
message "*3..."
pause 4
message "*2..."
pause 4
message "*1..."
pause 4
message "*0"
pause 2
message "*BOOM!*"
else
message ht[ent]
end if
else
message "*type '/th? overview' or 'th? quickstart' for instuctions"
message "*more information is available in the macro file 'Shares.txt'"
message "*thanks for trying this macro. Feedback is welcome"
end if
label END
}
InitThG
{
if initSwitch == 1
call shareMultiList
call AutoThank
call ThankGroup
call AddToThankGroup
call WhoAmIThanking
call ClearThankGroup
call ThankNext
call ThankOptions
call ThankRandom
call ThankSharers
end if
setglobal initSwitch 0
}
getThankTotal
{
set thankTMod thankTotal
set thankTMod - 1
message "thankTotal is " thankTMod
message "thankTarget is" thankTarget
}