Tiny Fugue is a command line mud clinet written for unix.
Auto Loot
;;; Auto Loot.
;;; usage /dead to enable
;;; /dead again to disable
/def -p1 -P0BCyellow -t'^([A-Za-z,-:\' ]*) is DEAD, R\\.I\\.P\\.$' dead_rip = \
/if (dead_action_status == 1) \
/eval %{dead_action}%; \
/endif
/def dead = \
/if (dead_action_status == 0) \
/echo -aBCcyan [Mob death trigger ON]%; \
/set dead_action_status=1%; \
/else \
/echo -aBCcyan [Mob death trigger OFF]%; \
/set dead_action_status=0%; \
/endif%; \
/set dead_action=%{*}%;
Send tells to a file
/test tellfile := tfopen("tell.log", "a")
/def -mregexp -t"^(.*) tells you '(.*)'" tells = /test tfwrite(tellfile, {P0})
Now you can open that file with tail -f tell.log in another terminal window.
Make Human Readable numbers
This will take a number and turn it into K,M or G as is appropiate.
/make_human_readable 123 gives 123
/make_human_readable 1234 gives 1.23K
/make_human_readable 12345 gives 12.3K
/make_human_readable 123456 gives 1.23M
/def make_human_readable = \
/if (abs({1}) >= 1000000000) /return strcat(substr({1} / 1000000000.0, 0, 5), 'G')%; \
/elseif (abs({1}) >= 1000000) /return strcat(substr({1} / 1000000.0, 0, 5), 'M')%; \
/elseif (abs({1}) >= 1000) /return strcat(substr({1} / 1000.0, 0, 5), 'K')%; \
/else /return {1}%; \
/endif
Prompt
This code will parse the prompt and display it on the status line.
It assumes the following prompt:
prompt hp:<chp>(<maxhp>) sp:<sp>(<maxsp>) exp:<exp>(<tonext>) last:<last_exp> cash:<cash>(<bank>) <scan>:
Here is an example:
hp:356(356) sp:1843(1843) exp:1042600(18907400) last:-1442500 cash:896(496805) Not in battle:
The result looks like this:
_hp:356(100%)______sp:1.843K(100%)___exp:1.042M(5%) -1.44M__$:896(496.8K)_____Target:Not in battle______
/def -mregexp -h"PROMPT hp:(\-?\d+)\((\-?\d+)\) sp:(\-?\d+)\((\-?\d+)\) exp:(\-?\d+)\((\-?\d+)\) last:(\-?\d+) cash:(\-?\d+)\((\-?\d+)\) (.*):" catch_prompt = \
/set hp=%{P1} %;\
/set hp_max=%{p2} %;\
/set sp=%{P3} %;\
/set sp_max=%{p4} %;\
/set exp=%{p5} %;\
/set exp_tolevel=%{p6} %;\
/set exp_last=%{p7} %;\
/set cash=%{p8} %;\
/set bank=%{p9} %;\
/set target_status=%{p10} %;\
/test hp_disp:=strcat('hp:',make_human_readable(hp), '(', hp*100/hp_max, '\%)') %;\
/test sp_disp:=strcat('sp:',make_human_readable(sp), '(', sp*100/sp_max, '\%)') %;\
/test exp_disp:=strcat('exp:',make_human_readable(exp), '(', exp*100/exp_tolevel, '\%) ', make_human_readable(exp_last)) %;\
/test bank_disp:=strcat('\$:',make_human_readable(cash), '(', make_human_readable(bank), ')') %;\
/test target_disp:=strcat('Target:', target_status)
/eval /set status_fields=
/status_add hp_disp:17
/status_add sp_disp:17
/status_add exp_disp:22
/status_add bank_disp:17
/status_add target_disp
"Run" script
This script automates the movement between mods, as well as conveying a little information about each one.
The format for a "run" is comma seperated list of directions/actions, mobs are spcified with trigger:MOB[:EXTRA INFO], and to pause not at a mob use the format pause:[EXTRA INFO]. Here's an example run for the druid towers.
/test _druidarea := "15 w,5 sw,12 w,path,s,w,target:ent:18K \
,u,target:willow:29K \
,u,target:trifolium:67K \
,u,target:stumpwood:107K \
,3 d,2 e,target:snake:18K \
,u,target:bull:41K \
,u,target:bear:49K \
,u,target:gorilla:67K \
,u,target:beetle:110K \
,4 d,w,s,w,target:fungus:18K \
,u,target:cube:35K \
,u,target:spore:49K \
,u,target:battlefungus:109K \
,3 d,E,target:elemental:18K \
,u,target:elemental:35K \
,u,target:elemental:42K \
,u,target:elemental:48K \
,u,target:elemental:110K \
,4 d,w,s,target:dragon:109K \
,u,target:Pegasus:42K \
,u,target:nymph:48K \
,u,target:djinni:58K \
,u,target:basilisk \
,4 d,N,path,12 e,5 ne,15 e,p' At CS"
/def druidarea = /_dorun %{_druidarea}
And here's the code.
/def -i list_print = \
/@test _value := %{1} %;\
/eval /echo %{_value}
/def -i run_list_pop = \
/test list_pos:=strstr(list, ",") %;\
/if (list_pos < 0) \
/test list_pos := strlen(list) %;\
/endif %;\
/test _val := substr(list, 0, list_pos) %; \
/test list := substr(list, list_pos + 1) %;\
/result "%{_val}"
/def testrun = /_dorun 'testrun,pause:this is a pause,target:target:targeting target,'end run
/def _dorun = \
brief %; \
/if (strlen(%*) > 0) \
/test list := "%*" %; \
party create stats%; \
/endif %; \
/while (strlen(list) > 0) \
/test cmd := "$(/run_list_pop)" %;\
/if (strstr(cmd, ":") > -1) \
/if (strstr(cmd, "pause") > -1) \
/test info := substr(cmd, 6) %;\
/eval p' found pause %;\
/eval p' %{info} %;\
/break %;\
/endif %;\
/test target := substr(cmd, 7) %;\
/if (strstr(target, ":") > 0) \
/test info := substr(target, strstr(target, ":") + 1) %;\
/test target := substr(target, 0, strstr(target, ":")) %;\
/else \
/test info := " "%;\
/endif %;\
/eval p' target is: %{target}. %{info} %;\
/setpartytarget %{target} %;\
/break %;\
/endif %;\
/eval %{cmd} %;\
/done %; \
brief
last updated 2 years ago
#