Dark and Shattered Lands (DSL) Homepage

Thorn Keep
(Owners of this keep receive the thorn aura spell effect)
Current Owners: Shalonesti
Shalonesti
Taken From: Bloodlust

The Citadel
(Owners of this  keep receive bonus saves)
Current Owners: Bloodlust
Bloodlust
Taken From: Shalonesti

Misery Keep
(Owners of this keep controls the veil of misery spell)
Current Owners: Bloodlust
Bloodlust
Taken From: Justice

Current Spell Target: Conclave

Purgatory Keep
(Owners of this keep receive the Purgatory XP Bonus)
Current Owners: Darkonin
Darkonin
Last Owners: Thaxanos

Vote for DSL on TMC!
CURRENT CHAMPIONS of EVERYTHING
Gnarlroc
(AGL World Champion)
 
Azheri
(AGL Althainian Champion)
 
Ferg
(AGL Blade Champion)
 
Jojo
(AGL Crown Champion)
 
2nd Annual Magma Cup Champions

Karecus Card Sharks
Algoron World Games VIII Winners
Verminasia
Verminasia
ACFL Season 6 Champions

Karecus Card Sharks
Clan Wars XVII Champions

Justice
Forum Home Forum Home > Mud Client Help > Mud Client Information > Mac Client Scripts
  New Posts New Posts RSS Feed - Battle Condenser
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Battle Condenser

 Post Reply Post Reply Page  123>
Author
Message
gnome power View Drop Down
First Sergeant
First Sergeant
Avatar
Fear my graphs!

Joined: 02 July 2003
Location: United States
Status: Offline
Points: 11241
Post Options Post Options   Thanks (0) Thanks(0)   Quote gnome power Quote  Post ReplyReply Direct Link To This Post Topic: Battle Condenser
    Posted: 10 March 2012 at 1:00am
Quote Functions of this program:

1. Redirect combat spam to a miniconsole in small font, so you can tell at a glance what the combat looks like, but you aren't spammed by it in your main console window.

2. Echo condensed combat round summaries in your main console, which is robust to any number of attackers, any number of targets, any number of weapon nouns, skills etc.  Reports attacker, victim, total damage, number of hits, number of attempted hits, weapon nouns, and flags.

3. Generates HP, MP, and MV visual meters that adjust in real time.

4.  If under the Killing Rage status, the HP bar converts to a display that reports the total damage you have taken since raging, and the number of hp vamp flags you have inflicted since raging.  This resets as soon as your rage drops.

5. Generates a tick timer meter that adjusts in real time.

6. Gags unnecessary text, such as dodges, parries, chain arcs, etc.

7. Generates an xp meter that changes in real time. (You have to type score once and let it capture your character level in order to calibrate itself.)

note: As it is, this script is subject to a couple stipulations:

a. Your prompt must be a specific format: %T-(charactername) <%h/%H %m/%M %v/%V> (%S) [%e] (%X/%x)%c

b. You can't just pick and choose parts of the script to put in, unfortunately.  As it stands now, the prompt, tick timer, and condenser components are connected and removing any one will break the system.

c. This script is long, so prepare for a long post...


Steps to install:

1. In the Triggers tab, add a new group called Battle Condenser Script, and leave it empty.

In this Triggers tab, add the following items and input the following information:

a. 

name: Battle Damage Analyzer

regex field 0:

^(Your|[a-zA-Z\s\']+\'s) ([a-zA-Z]+\s?[a-zA-Z]*) (does\sGHASTLY\sthings\sto|does\sHORRID\sthings\sto|does\sDREADFUL\sthings\sto|does\sHIDEOUS\sthings\sto|does\sINDESCRIBABLE\sthings\sto|does\sUNSPEAKABLE\sthings\sto|misses|scratches|grazes|hits|injures|wounds|mauls|decimates|devastates|maims|MUTILATES|DISEMBOWELS|DISMEMBERS|MASSACRES|MANGLES|\*\*\*\sDEMOLISHES*\s\*\*\*|\*\*\*\sDEVASTATES*\s\*\*\*|\=\=\=\sOBLITERATES*\s\=\=\=|\>\>\>\sANNIHILATES\s\<\<\<|\<\<\<\sERADICATES\s\>\>\>) ([-a-zA-Z\'\s]+)([\.!])$

regex field 1:

^([a-zA-Z\s]+) (do[es]*\sGHASTLY\sthings\sto|do[es]*\sHORRID\sthings\sto|do[es]*\sDREADFUL\sthings\sto|do[es]*\sHIDEOUS\sthings\sto|do[es]*\sINDESCRIBABLE\sthings\sto|do[es]*\sUNSPEAKABLE\sthings\sto|miss[es]*|scratch[es]*|graze[s]*|hit[s]*|injure[s]*|wound[s]*|maul[s]*|decimate[s]*|devastate[s]*|maim[s]*|MUTILATE[S]*|DISEMBOWEL[S]*|DISMEMBER[S]*|MASSACRE[S]*|MANGLE[S]*|\*\*\*\sDEMOLISH[ES]*\s\*\*\*|\*\*\*\sDEVASTATE[S]*\s\*\*\*|\=\=\=\sOBLITERATE[S]*\s\=\=\=|\>\>\>\sANNIHILATE[S]*\s\<\<\<|\<\<\<\sERADICATE[S]*\s\>\>\>) ([-a-zA-Z\'\s]+)([\.!])$

(Don't forget to set both pulldown menus to perl regex)

Then add the following script to the main field:

--gnome power 3/9/12 version of battle condenser

damAssign = 0

punctuation=""

tail = ""

color = "olive_drab"

predam=""

deleteLine()

if rex.match(matches[6],"[.!]") then

attacker = matches[2]

noun = matches[3]

damVerb = matches[4]

damTarget = matches[5]

punctuation = matches[6]

else

attacker = matches[2]

noun = ""

damVerb = matches[3]

damTarget = matches[4]

punctuation = matches[5]

end

if rex.match(attacker,"'s") then

attacker = string.sub(attacker, 1, -3) -- chop two last letters off

end

if rex.match(damVerb,"scratch[es]*") then

damAssign = 2.5

color = "green"

elseif rex.match(damVerb,"graze[s]*") then

damAssign = 6.5

color = "green"

elseif rex.match(damVerb,"hit[s]*") then

damAssign = 10.5

color = "green"

elseif rex.match(damVerb,"injure[s]*") then

damAssign = 14.5

color = "green"

elseif rex.match(damVerb,"wound[s]*") then

damAssign = 18.5

color = "green"

elseif rex.match(damVerb,"maul[s]*") then

damAssign = 22.5

color = "green"

elseif rex.match(damVerb,"decimate[s]*") then

damAssign = 26.5

color = "green"

elseif rex.match(damVerb,"devastate[s]*") then

damAssign = 30.5

color = "green"

elseif rex.match(damVerb,"maim[s]*") then

damAssign = 34.5

color = "green"

elseif rex.match(damVerb,"MUTILATE[S]*") then

damAssign = 38.5

color = "yellow"

elseif rex.match(damVerb,"DISEMBOWEL[S]*") then

damAssign = 42.5

color = "yellow"

elseif rex.match(damVerb,"DISMEMBER[S]*") then

damAssign = 46.5

color = "yellow"

elseif rex.match(damVerb,"MASSACRE[S]*") then

damAssign = 50.5

color = "yellow"

elseif rex.match(damVerb,"MANGLE[S]*") then

damAssign = 54.5

color = "yellow"

elseif rex.match(damVerb,"DEMOLISH[ES]") then

damAssign = 58.5

predam = "*** "

color = "red"

tail = " ***"

if rex.match(damVerb,"DEMOLISHES") then damVerb = "DEMOLISHES"

elseif rex.match(damVerb,"DEMOLISH") then damVerb = "DEMOLISH" end

elseif rex.match(damVerb,"DEVASTATE[S]") then

damAssign = 68

predam = "*** "

color = "red"

tail = " ***"

if rex.match(damVerb,"DEVASTATES") then damVerb = "DEVASTATES"

elseif rex.match(damVerb,"DEVASTATE") then damVerb = "DEVASTATE" end

elseif rex.match(damVerb,"OBLITERATE[S]") then

damAssign = 88

predam = "=== "

color = "red"

tail = " ==="

damVerb = "OBLITERATES"

elseif rex.match(damVerb,"ANNIHILATE[S]*") then

damAssign = 113

predam = ">>> "

color = "red"

tail = " <<<"

if rex.match(damVerb,"ANNIHILATES") then damVerb = "ANNIHILATES"

elseif rex.match(damVerb,"ANNIHILATE") then damVerb = "ANNIHILATE" end

elseif rex.match(damVerb,"ERADICATE[S]") then

damAssign = 138

predam = "<<< "

color = "red"

tail = " >>>"

if rex.match(damVerb,"ERADICATES") then damVerb = "ERADICATES"

elseif rex.match(damVerb,"ERADICATE") then damVerb = "ERADICATE" end

elseif rex.match(damVerb,"GHASTLY") then

damAssign = 163

damVerb = "GHASTLY"

elseif rex.match(damVerb,"HORRID") then

damAssign = 188

damVerb = "HORRID"

elseif rex.match(damVerb,"DREADFUL") then

damAssign = 213

damVerb = "DREADFUL"

elseif rex.match(damVerb,"HIDEOUS") then

damAssign = 238

damVerb = "HIDEOUS"

elseif rex.match(damVerb,"INDESCRIBABLE") then

damAssign = 263

damVerb = "INDESCRIBABLE"

elseif rex.match(damVerb,"UNSPEAKABLE") then

damAssign = 276

damVerb = "UNSPEAKABLE"

end

cecho("battle_window",attacker .. " ".. noun .." ".. predam .."<"..color..">" ..damVerb .."<white>" .. tail .. " " .. damTarget .. punctuation .. " [ " .. damAssign .. " ]\n") --reports damage into the miniconsole

if not battle_data then

battle_data = {}

end

if not battle_data[attacker] then

battle_data[attacker]= {}

end

if not battle_data[attacker][damTarget] then

battle_data[attacker][damTarget]= {}

end

if not battle_data[attacker][damTarget][noun] then

battle_data[attacker][damTarget][noun]= {}

end

if not battle_data[attacker][damTarget][noun]["hits"] then

battle_data[attacker][damTarget][noun]["hits"]= 0

end

if not battle_data[attacker][damTarget][noun]["misses"] then

battle_data[attacker][damTarget][noun]["misses"]= 0

end

if damAssign > 0 then

battle_data[attacker][damTarget][noun]["hits"] = battle_data[attacker][damTarget][noun]["hits"] + 1

else

battle_data[attacker][damTarget][noun]["misses"] = battle_data[attacker][damTarget][noun]["misses"] + 1

end --if

if not battle_data[attacker][damTarget][noun]["total_hits"] then

battle_data[attacker][damTarget][noun]["total_hits"]=0

end

battle_data[attacker][damTarget][noun]["total_hits"] = battle_data[attacker][damTarget][noun]["total_hits"] + 1

if not battle_data[attacker][damTarget][noun]["dam"] then

battle_data[attacker][damTarget][noun]["dam"] = 0

end

battle_data[attacker][damTarget][noun]["dam"] = battle_data[attacker][damTarget][noun]["dam"] + damAssign

if tostring(promptCurrentHP) == "???" then

if not damageTaken then

damageTaken = 0

end

if rex.match(damTarget,"[Yy]ou[r]*") then

damageTaken = damageTaken + damAssign

end

else

damageTaken = 0

end





Edited by gnome power - 10 March 2012 at 11:36pm
Back to Top
gnome power View Drop Down
First Sergeant
First Sergeant
Avatar
Fear my graphs!

Joined: 02 July 2003
Location: United States
Status: Offline
Points: 11241
Post Options Post Options   Thanks (0) Thanks(0)   Quote gnome power Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2012 at 1:01am
b. Add item

name: Enemy Battle Evasion Counter

regex 0 (remember to set everything to "perl regex" pulldown menu option):

^You parry ([a-zA-Z\s\']+) attack.

regex 1:

^You block ([a-zA-Z\s\']+) attack with your shield.

regex 2:

^You dodge ([a-zA-Z\s\']+) attack.

(note: this doesn't count danger senses currently.  The echos don't allow you to know who the attacker is, so I'm not sure how to deal with that. Suggestions are welcome.)

main script:

attacker = matches[2]

if rex.match(attacker,"'s") then

attacker = string.sub(attacker, 1, -3) -- chop two last letters off

end

--attacker = attacker:gsub("^%l", string.upper) -- uppercase first letter only

if not battle_data then

battle_data = battle_data or {}

end

if not battle_data[attacker] then

battle_data[attacker]=battle_data[attacker] or {}

end

if not battle_data[attacker]["you"] then

battle_data[attacker]["you"] = {}

end

if not battle_data[attacker]["you"]["evaded"] then

battle_data[attacker]["you"]["evaded"] = {}

end

if not battle_data[attacker]["you"]["evaded"]["misses"] then

--battle_data[attacker]["you"]["evaded"]["misses"] = {}

battle_data[attacker]["you"]["evaded"]["misses"] = 0

end

battle_data[attacker]["you"]["evaded"]["misses"] = battle_data[attacker]["you"]["evaded"]["misses"] + 1

c.  New item

name: My Battle Evasion Counter

perl regex 0:

^([a-zA-Z\s\']+) dodges your attack.

perl regex 1:

^([a-zA-Z\s\']+) parries your attack.

perl regex 2:

^([a-zA-Z\s\']+) blocks your attack with a shield.

perl regex 3:

^([a-zA-Z\s\']+) senses they're about to be hit and deflects the blow.

main field:

if matches[2] ~= nil then

damTarget = matches[2]

end

if not battle_data then

battle_data = battle_data or {}

end

if not battle_data["You"] then

battle_data["You"] = {}

end

if not battle_data["You"][damTarget] then

battle_data["You"][damTarget] = {}

end

if not battle_data["You"][damTarget]["evaded"] then

battle_data["You"][damTarget]["evaded"] = {}

end

if not battle_data["You"][damTarget]["evaded"]["total_hits"] then

--battle_data["You"][damTarget]["evaded"]["total_hits"] = {}

battle_data["You"][damTarget]["evaded"]["total_hits"] = 0

end

battle_data["You"][damTarget]["evaded"]["total_hits"] = battle_data["You"][damTarget]["evaded"]["total_hits"] + 1

deleteLine()

d. new item:

name: Lightning Flag Counter

regex 0:

^([a-zA-Z\s\']+) is struck by lightning from ([a-zA-Z\s\']+)

(Note: I haven't added the regex for getting hit by lightning flag or several other flags.  If you provide these echos to me I can add them.)

main field:

if not battle_data then

battle_data = battle_data or {}

end

if not battle_data[attacker] then

battle_data[attacker]=battle_data[attacker] or {}

end

if not battle_data[attacker][damTarget] then

battle_data[attacker][damTarget]= {}

end

if not battle_data[attacker][damTarget][noun] then

battle_data[attacker][damTarget][noun]= {}

end

if not battle_data[attacker][damTarget][noun]["L"] then

battle_data[attacker][damTarget][noun]["L"] = {}

end

battle_data[attacker][damTarget][noun]["L"] = 1

deleteLine()

e. new item

name: flaming flag counter

perl regex 0:

^([a-zA-Z\s\']+) is burned by ([a-zA-Z\s\']+)

f. new item

name: hp vamp flag counter

perl regex 0:

^([a-zA-Z\s\']+) draws life from ([a-zA-Z\s\']+)

perl regex 1:

^You feel ([a-zA-Z\s\']+) drawing your life away.

main field:

if not battle_data then

battle_data = battle_data or {}

end

if not battle_data[attacker] then

battle_data[attacker]=battle_data[attacker] or {}

end

if not battle_data[attacker][damTarget] then

battle_data[attacker][damTarget]= {}

end

if not battle_data[attacker][damTarget][noun] then

battle_data[attacker][damTarget][noun]= {}

end

if not battle_data[attacker][damTarget][noun]["H"] then

battle_data[attacker][damTarget][noun]["H"] = {}

end

battle_data[attacker][damTarget][noun]["H"] = 1

deleteLine()

if promptCurrentHP == "???" then

if not hpVamps then

hpVamps = 0

end

if rex.match(attacker,"[Yy]ou[r]*") then

hpVamps = hpVamps + 1

end

else

hpVamps = 0

end

g. new item

name: Mana Vamp Flag Counter

perl regex 0:

^You feel something drawing your energy away

perl regex 1:

^([a-zA-Z\s\']+) draws energy from ([a-zA-Z\s\']+)

main field:

if not battle_data then

battle_data = battle_data or {}

end

if not battle_data[attacker] then

battle_data[attacker]=battle_data[attacker] or {}

end

if not battle_data[attacker][damTarget] then

battle_data[attacker][damTarget]= {}

end

if not battle_data[attacker][damTarget][noun] then

battle_data[attacker][damTarget][noun]= {}

end

if not battle_data[attacker][damTarget][noun]["M"] then

battle_data[attacker][damTarget][noun]["M"] = {}

end

battle_data[attacker][damTarget][noun]["M"] = 1

deleteLine()

h. new item

name: stun flag counter

perl regex 0:

^([a-zA-Z\s\']+) is knocked to the ground by ([a-zA-Z\s\']+)

(note: This script is specifically designed not to gag the stun echo)

if not battle_data then

battle_data = battle_data or {}

end

if not battle_data[attacker] then

battle_data[attacker]=battle_data[attacker] or {}

end

if not battle_data[attacker][damTarget] then

battle_data[attacker][damTarget]= {}

end

if not battle_data[attacker][damTarget][noun] then

battle_data[attacker][damTarget][noun]= {}

end

if not battle_data[attacker][damTarget][noun]["S"] then

battle_data[attacker][damTarget][noun]["S"] = {}

end

battle_data[attacker][damTarget][noun]["S"] = 1

i. new item

name: Freeze Flag Counter

perl regex 0:

^([a-zA-Z\s\']+) freezes ([a-zA-Z\s\']+)

main field:

if not battle_data then

battle_data = battle_data or {}

end

if not battle_data[attacker] then

battle_data[attacker]=battle_data[attacker] or {}

end

if not battle_data[attacker][damTarget] then

battle_data[attacker][damTarget]= {}

end

if not battle_data[attacker][damTarget][noun] then

battle_data[attacker][damTarget][noun]= {}

end

if not battle_data[attacker][damTarget][noun]["F"] then

battle_data[attacker][damTarget][noun]["F"] = {}

end

battle_data[attacker][damTarget][noun]["F"] = 1

deleteLine()

j. new item

name: condition tracker

perl regex 0:

([a-zA-Z\s']+) is in excellent condition.[\s]*$

perl regex 1:

([a-zA-Z\s']+) has a few scratches.[\s]*$

perl regex 2:

([a-zA-Z\s']+) has some small wounds and bruises.[\s]*$

perl regex 3:

([a-zA-Z\s']+) has quite a few wounds.[\s]*$

perl regex 4:

([a-zA-Z\s']+) has some big nasty wounds and scratches.[\s]*$

perl regex 5:

([a-zA-Z\s']+) looks pretty hurt.[\s]*$

perl regex 6:

([a-zA-Z\s']+) is in awful condition.[\s]*$

perl regex 7:

^([a-zA-Z\s\']+) is DEAD!!

main field:

percentage = ""

wascondition = 0

conditiontext =""

if not rex.match(matches[1],"is DEAD") then

isDead = 0

else

isDead = 1

end

if battle_data then

deleteLine()

outputDamage()

battle_data = nil

if rex.match(matches[1],"excellent condition") then

percentage = " [<green>100%<white>]"

wascondition = 1

conditiontext = " is in excellent condition."

elseif rex.match(matches[1],"few scratches") then

percentage = " [<green>90-99%<white>]"

wascondition = 1

conditiontext = " has a few scratches."

elseif rex.match(matches[1],"has some small wounds and bruises") then

percentage = " [<green>75-89%<white>]"

wascondition = 1

conditiontext = " has some small wounds and bruises."

elseif rex.match(matches[1],"has quite a few wounds") then

percentage = " [<green>50-74%<white>]"

wascondition = 1

conditiontext = " has quite a few wounds."

elseif rex.match(matches[1],"has some big nasty wounds and scratches") then

percentage = " [<green>30-49%<white>]"

wascondition = 1

conditiontext = " has some big nasty wounds and scratches."

elseif rex.match(matches[1],"looks pretty hurt") then

percentage = " [<green>15-29%<white>]"

wascondition = 1

conditiontext = " looks pretty hurt."

elseif rex.match(matches[1],"is in awful condition") then

percentage = " [<green>0-14%<white>]"

wascondition = 1

conditiontext = " is in awful condition."

end

end

if wascondition == 1 then

if isDead == 0 then

cecho("<red>"..tostring(matches[2]).."<white>"..tostring(conditiontext)..tostring(percentage))

else

cecho("<red>"..tostring(matches[2]).."<white>"..tostring(conditiontext))

end

end

cecho("battle_window","\n") --puts a space into the miniconsole

if isDead == 1 then

cecho("battle_window",tostring(matches[2]).." is DEAD!! \n\n")

cecho("<purple>"..tostring(matches[2]).." is DEAD!! <white>\n")

end

k. new item

name: Combat Text Gag

perl regex 0:

^You parry ([a-zA-Z\s\']+) attack.

perl regex 1:

You block ([a-zA-Z\s\']+) attack with your shield.

perl regex 2:

You dodge ([a-zA-Z\s\']+) attack.

perl regex 3:

^([-a-zA-Z\s\']+)dodges your attack.

perl regex 4:

^([a-zA-Z\s\']+)parries your attack.

perl regex 5:

^([a-zA-Z\s\']+)blocks your attack with a shield.

perl regex 6:

^([a-zA-Z\s\']+)senses they're about to be hit and deflects the blow.

perl regex 7:

^([a-zA-Z\s\']+)senses your attack coming and avoids its blow.

perl regex 8:

^The bolt arcs to

perl regex 9:

^A lightning bolt leaps from your hand and arcs to

perl regex 10:

You sense you're about to be hit and deflect the blow.

perl regex 11:

You sense an attack coming and avoid its blow.

perl regex 12:

A lightning bolt leaps from ([a-zA-Z\s\']+) hand and arcs to ([a-zA-Z\s\']+).

main script:

deleteLine()


Back to Top
gnome power View Drop Down
First Sergeant
First Sergeant
Avatar
Fear my graphs!

Joined: 02 July 2003
Location: United States
Status: Offline
Points: 11241
Post Options Post Options   Thanks (0) Thanks(0)   Quote gnome power Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2012 at 1:02am
2. In triggers tab, Add Group and call it Prompt.  In this folder,

a. create new item

name: Parse Prompt

perl regex 0:

^[Quiet\s]*([0-9]+):([0-9]+)([amp]+)-\(([a-zA-Z\s']+)\) \<([?\d]+)\/([?\d]+) (\d+)\/(\d+) (\d+)\/(\d+)\> \((\w+)\) \[([a-zA-Z0-9-]*)\] \((\d+)/(\d+)\)

main script:

--prompt %T-(name) <%h/%H %m/%M %v/%V> (%S) [%e] (%X/%x)%c

promptHours = matches[2]

promptMin = matches[3]

promptAMPM = matches[4]

promptName = matches[5]

promptCurrentHP = matches[6]

promptMaxHP = matches[7]

promptCurrentMP = matches[8]

promptMaxMP = matches[9]

promptCurrentMV = matches[10]

promptMaxMV = matches[11]

promptStance = matches[12]

promptDirs = matches[13]

promptCurrentXP = matches[14]

promptTotalXP = matches[15]

refreshStatBars()

if promptCurrentHP == "???" then

if not damageTaken then

damageTaken = 0

end

if not hpVamps then

hpVamps = 0

end

setGauge("hp_bar", 1, 1,"<font color=\"white\">Dam: "..tostring(damageTaken).." V: "..tostring(hpVamps))

else

setGauge("hp_bar", promptCurrentHP, promptMaxHP,"<font color=\"white\">"..promptCurrentHP.." / "..promptMaxHP.." HP")

end

setGauge("mana_bar", promptCurrentMP, promptMaxMP,"<font color=\"white\">"..promptCurrentMP.." / "..promptMaxMP.." MP")

setGauge("end_bar", promptCurrentMV, promptMaxMV,"<font color=\"white\">"..promptCurrentMV.." / "..promptMaxMV.." MV")

charLevel = charLevel or 42

setGauge("xp_bar", promptCurrentXP, (promptCurrentXP+promptTotalXP)/charLevel,"<font color=\"white\">"..promptCurrentXP.." tnl (setLevel: "..charLevel..")")

if (promptMin ~= last_time) then

last_time = promptMin

echo("\nTick change\n")

if current_tick_timer then

killTimer(current_tick_timer)

current_tick_timer = nil

end

incrementGauge("tick_bar",37,.1) --gauge name, remaining tick time, increment

end

-- display time to tick if less than 5 seconds

if remainingTime < 5 then

echo("\nTick in " .. remainingTime .. " seconds.\n")

end

if battle_data then

outputDamage()

battle_data = nil

end

b. Add Item

name: Level Up

perl regex 0:

^You raise a level!!

main script:

charLevel = charLevel + 1

c. Add item

name: Set My Level

perl regex 0:

^LEVEL: (\d+)

main script:

if charLevel ~= matches[2] then

charLevel = matches[2]

echo("Level set to "..charLevel)

end

3. In "Scripts" tab, Add New Group called Battle Condenser.  In this folder, paste this to main script field:

function outputDamage()

if battle_data then

echo("\n")

end

for attackers, damTargets in pairs (battle_data) do

--convert "You" and "Your" to character name for attacker

myName = tostring(attackers)

if rex.match(tostring(attackers),"[Yy]ou[r]*") then

attackerName = tostring(promptName)

else

attackerName = tostring(attackers)

end

for victims, nouns in pairs (damTargets) do

hitTot = 0

totHitTot = 0

damageTot = 0

flagreport = ""

nounList = nil

--convert "You" and "Your" to character name for victim

if rex.match(tostring(victims),"[Yy]ou[r]*") then

victimName = tostring(promptName)

else

victimName = tostring(victims)

end

for nountypes, info in pairs (nouns) do

--generate flag results

if info["L"] == 1 then

if not rex.match(tostring(flagreport),"L") then

flagreport = tostring(flagreport).."<gold>L<white>"

end

end

if info["F"] == 1 then

if not rex.match(tostring(flagreport),"F") then

flagreport = tostring(flagreport).."<red>F<white>"

end

end

if info["H"] == 1 then

if not rex.match(tostring(flagreport),"H") then

flagreport = tostring(flagreport).."<cornsilk>H<white>"

end

end

if info["M"] == 1 then

if not rex.match(tostring(flagreport),"M") then

flagreport = tostring(flagreport).."<deep_pink>M<white>"

end

end

if info["S"] == 1 then

if not rex.match(tostring(flagreport),"S") then

flagreport = tostring(flagreport).."<dark_orchid>S<white>"

end

end

if info["F"] == 1 then

if not rex.match(tostring(flagreport),"F") then

flagreport = tostring(flagreport).."<powder_blue>F<white>"

end

end

if not rex.match(tostring(nountypes),"evaded") then

if not rex.match(tostring(nountypes),"nil") then

if not nounList then

nounList = tostring(nountypes)

elseif not rex.match(tostring(nountypes),tostring(Nounlist)) then

nounList = tostring(nounList)..", "..tostring(nountypes)

end

end

end

--sum up the damage, hits, and total_hits

if info.dam then

if info.dam > 0 then

damageTot = damageTot + info.dam

end

end

if info.hits then

hitTot = hitTot + info.hits

end

if info.total_hits then

totHitTot = totHitTot + info.total_hits

end

end

--output for specific attacker/victim combination

--nounList = string.sub(nounList, 1, 3) -- chop two first letters off

if hitTot > 0 then

cecho("<light_blue>"..tostring(attackerName).."<white> => <red>"..tostring(victimName).."<white>: "..tostring(damageTot).." ("..tostring(hitTot).."/"..tostring(totHitTot)..") ["..tostring(nounList).."] "..tostring(flagreport).."\n")

end

end

end

end

4. In Scripts tab, add new group called Tick Timer.  Paste to main script field:

function incrementGauge(inputGauge,totalTime,timeIncrementationInput)

timeIncrementation = timeIncrementationInput or 0.1

remainingTime = totalTime or 42

gauge = inputGauge

if remainingTime > 0 then

current_tick_timer = tempTimer(timeIncrementation, [[

remainingTime = remainingTime - timeIncrementation

remainingTime = round(remainingTime,1)

setGauge(gauge,remainingTime, 41, "<font color=\"white\">Tick: "..remainingTime)

incrementGauge(gauge,remainingTime,timeIncrementation)]])

end

end


5. In Scripts tab, add new group called Create Gauge Bars.  Paste to main script field:

function create_hp_bar(x,y)

createGauge("hp_bar", 0, 0, 0, 0, nil, "red")

moveGauge("hp_bar", x,y)

resizeGauge("hp_bar", 150, 20)

setGaugeStyleSheet("hp_bar", [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #f04141, stop: 0.1 #ef2929, stop: 0.49 #cc0000, stop: 0.5 #a40000, stop: 1 #cc0000);

border-top: 1px black solid;

border-left: 1px black solid;

border-bottom: 1px black solid;

border-radius: 7;

padding: 3px;]],

[[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bd3333, stop: 0.1 #bd2020, stop: 0.49 #990000, stop: 0.5 #700000, stop: 1 #990000);

border-width: 1px;

border-color: black;

border-style: solid;

border-radius: 7;

padding: 3px;]])

end

function create_group_hp_bar(name, x,y)

createGauge(name.."_hp_bar", 0, 0, 0, 0, nil, "red")

moveGauge(name.."_hp_bar", x,y)

resizeGauge(name.."_hp_bar", 100, 5)

setGaugeStyleSheet(name.."_hp_bar", [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #f04141, stop: 0.1 #ef2929, stop: 0.49 #cc0000, stop: 0.5 #a40000, stop: 1 #cc0000);

border-top: 1px black solid;

border-left: 1px black solid;

border-bottom: 1px black solid;

border-radius: 7;

padding: 3px;]],

[[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bd3333, stop: 0.1 #bd2020, stop: 0.49 #990000, stop: 0.5 #700000, stop: 1 #990000);

border-width: 1px;

border-color: black;

border-style: solid;

border-radius: 7;

padding: 3px;]])

end

function create_group_mana_bar(name,x,y)

createGauge(name.."_mana_bar", 0, 0, 0, 0, nil, "blue")

moveGauge(name.."_mana_bar", x,y)

resizeGauge(name.."_mana_bar", 100, 5)

setGaugeStyleSheet(name.."_mana_bar", [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #414df0, stop: 0.1 #1120ee, stop: 0.49 #0d17a0, stop: 0.5 #030963, stop: 1 #0d17a0);

border-top: 1px black solid;

border-left: 1px black solid;

border-bottom: 1px black solid;

border-radius: 7;

padding: 3px;]],

[[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #646bce, stop: 0.1 #454dbf, stop: 0.49 #323781, stop: 0.5 #1d1f49, stop: 1 #323781);

border-width: 1px;

border-color: black;

border-style: solid;

border-radius: 7;

padding: 3px;]])

end

function create_mana_bar(x,y)

createGauge("mana_bar", 0, 0, 0, 0, nil, "blue")

moveGauge("mana_bar", x,y)

resizeGauge("mana_bar", 150, 20)

setGaugeStyleSheet("mana_bar", [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #414df0, stop: 0.1 #1120ee, stop: 0.49 #0d17a0, stop: 0.5 #030963, stop: 1 #0d17a0);

border-top: 1px black solid;

border-left: 1px black solid;

border-bottom: 1px black solid;

border-radius: 7;

padding: 3px;]],

[[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #646bce, stop: 0.1 #454dbf, stop: 0.49 #323781, stop: 0.5 #1d1f49, stop: 1 #323781);

border-width: 1px;

border-color: black;

border-style: solid;

border-radius: 7;

padding: 3px;]])

end

function create_end_bar(x,y)

createGauge("end_bar", 0, 0, 0, 0, nil, "green")

moveGauge("end_bar", x,y)

resizeGauge("end_bar", 150, 20)

setGaugeStyleSheet("end_bar", [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #98f041, stop: 0.1 #8cf029, stop: 0.49 #66cc00, stop: 0.5 #52a300, stop: 1 #66cc00);

border-top: 1px black solid;

border-left: 1px black solid;

border-bottom: 1px black solid;

border-radius: 7;

padding: 3px;]],

[[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #78bd33, stop: 0.1 #6ebd20, stop: 0.49 #4c9900, stop: 0.5 #387000, stop: 1 #4c9900);

border-width: 1px;

border-color: black;

border-style: solid;

border-radius: 7;

padding: 3px;]])

end

function create_tick_bar(x,y)

createGauge("tick_bar", 0, 0, 0, 0, nil, "gray")

moveGauge("tick_bar", x,y)

resizeGauge("tick_bar", 300, 5)

setGaugeStyleSheet("tick_bar", [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #dcdde0, stop: 0.1 #bdbec1, stop: 0.49 #999a9f, stop: 0.5 #707175, stop: 1 #999a9f);

border-top: 1px black solid;

border-left: 1px black solid;

border-bottom: 1px black solid;

border-radius: 7;

padding: 3px;]],

[[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #4e5055, stop: 0.1 #383a3d, stop: 0.49 #2a2b2c, stop: 0.5 #0d0d0d, stop: 1 #2a2b2c);

border-width: 1px;

border-color: black;

border-style: solid;

border-radius: 7;

padding: 3px;]])

end

function create_xp_bar(x,y)

createGauge("xp_bar", 0, 0, 0, 0, nil, "gray")

moveGauge("xp_bar", x,y)

resizeGauge("xp_bar", 150, 5)

setGaugeStyleSheet("xp_bar", [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #de7ffa, stop: 0.1 #cc3cf6, stop: 0.49 #b511e4, stop: 0.5 #5a0971, stop: 1 #b511e4);

border-top: 1px black solid;

border-left: 1px black solid;

border-bottom: 1px black solid;

border-radius: 7;

padding: 3px;]],

[[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #e1bda3, stop: 0.1 #c98b5e, stop: 0.49 #a76739, stop: 0.5 #7a4e2e, stop: 1 #a76739);

border-width: 1px;

border-color: black;

border-style: solid;

border-radius: 7;

padding: 3px;]])

end

function refreshStatBars()

create_hp_bar(0,550)

create_mana_bar(150,550)

create_end_bar(300,550)

end

(note: you can change the coordinates of create_hp_bar, create_mana_bar, and create_end_bar in function refreshStatBars() in order to put them on different pixels on your screen.)

6. in Scripts tab, add new group named Math, and paste this into main script field:

function round(num, idp)

if idp and idp>0 then

local mult = 10^idp

return math.floor(num * mult + 0.5) / mult

end

return math.floor(num + 0.5)

end

7.  in Scripts tab, add new group named onConnect, and paste this into main script field (NOTE: IF you already have an onConnect function from different code floating around this forum, you don't want to duplicat ethat function.  Instead, just add the functions in here that you don't have already to your existing onConnect function)

function onConnect()

window_w, window_h = getMainWindowSize()

create_tick_bar(0,570)

create_xp_bar(300,570)

createConsole("battle_window", 8, 80, 25, 493, 320)

refreshStatBars()

global_width, global_height = getMainWindowSize()

global_width = global_width - 15

global_chatPosX = global_width - global_chatWidth

global_chatPosY = 0

end

(NOTE2: you can change the position of tick bar and xp bar by adjusting the coordinates in the create_tick_bar(x,y) and create_xp_bar(x,y) functions respectively.  Also, you can adjust the position and size of the battle spam miniconsole by adjusting the numbers in that function)
----

And then you're done!

Any questions and suggestions for future design adjustments are welcome.
Back to Top
Jeckyl View Drop Down
Sergeant First Class
Sergeant First Class
Avatar

Joined: 24 August 2011
Location: MN
Status: Offline
Points: 2503
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jeckyl Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2012 at 1:53am
Where is a good source to learn this from scratch? :p
<-- This is what happens when you try to pk with the Illuminati.

--

If we changed everything that everyone whined about, DSL would be a kitten paradise and there would be minutely copyovers. -Bioteq
Back to Top
gnome power View Drop Down
First Sergeant
First Sergeant
Avatar
Fear my graphs!

Joined: 02 July 2003
Location: United States
Status: Offline
Points: 11241
Post Options Post Options   Thanks (0) Thanks(0)   Quote gnome power Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2012 at 1:58am
I only just learned Lua over the weekend.  Just scoured google until stuff made sense.  Asked a couple questions in the Mudlet forums.
Back to Top
Jeckyl View Drop Down
Sergeant First Class
Sergeant First Class
Avatar

Joined: 24 August 2011
Location: MN
Status: Offline
Points: 2503
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jeckyl Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2012 at 12:39pm
import/export functionality == much easier. :p

I got it up, going to go through the code and figure it out (if I can).

Thanks!
<-- This is what happens when you try to pk with the Illuminati.

--

If we changed everything that everyone whined about, DSL would be a kitten paradise and there would be minutely copyovers. -Bioteq
Back to Top
gnome power View Drop Down
First Sergeant
First Sergeant
Avatar
Fear my graphs!

Joined: 02 July 2003
Location: United States
Status: Offline
Points: 11241
Post Options Post Options   Thanks (0) Thanks(0)   Quote gnome power Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2012 at 12:44pm
Cool, if you have any questions let me know.

I didn't do the export because I had trouble installing other people's xml files when I first got mudlet.  Is there a trick to it?
Back to Top
Ashtai View Drop Down
First Sergeant
First Sergeant
Avatar

Joined: 23 September 2011
Status: Offline
Points: 7107
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ashtai Quote  Post ReplyReply Direct Link To This Post Posted: 15 March 2012 at 1:12pm
Is there a reason you formatted your regular expressions like that?
Back to Top
gnome power View Drop Down
First Sergeant
First Sergeant
Avatar
Fear my graphs!

Joined: 02 July 2003
Location: United States
Status: Offline
Points: 11241
Post Options Post Options   Thanks (0) Thanks(0)   Quote gnome power Quote  Post ReplyReply Direct Link To This Post Posted: 15 March 2012 at 2:20pm
Feel free to improve it, but I made the damage specific because a more general form would catch undesirable strings.
Back to Top
Drax View Drop Down
Sergeant
Sergeant
Avatar

Joined: 27 June 2003
Location: Canada
Status: Offline
Points: 805
Post Options Post Options   Thanks (0) Thanks(0)   Quote Drax Quote  Post ReplyReply Direct Link To This Post Posted: 15 March 2012 at 11:11pm
This topic would be improved tremendously by pictures of the script in action!
Back to Top
gnome power View Drop Down
First Sergeant
First Sergeant
Avatar
Fear my graphs!

Joined: 02 July 2003
Location: United States
Status: Offline
Points: 11241
Post Options Post Options   Thanks (1) Thanks(1)   Quote gnome power Quote  Post ReplyReply Direct Link To This Post Posted: 15 March 2012 at 11:25pm

Gray bar is tick timer, purple bar is xp progress.
Back to Top
Drax View Drop Down
Sergeant
Sergeant
Avatar

Joined: 27 June 2003
Location: Canada
Status: Offline
Points: 805
Post Options Post Options   Thanks (0) Thanks(0)   Quote Drax Quote  Post ReplyReply Direct Link To This Post Posted: 16 March 2012 at 6:19am
That's seriously nifty, GP. Innovative and very nicely put together, by the looks of it. Clap

I'm assuming the hp, mana and xp bars update with each new prompt. How often does the bar for the tick timer update?
Back to Top
gnome power View Drop Down
First Sergeant
First Sergeant
Avatar
Fear my graphs!

Joined: 02 July 2003
Location: United States
Status: Offline
Points: 11241
Post Options Post Options   Thanks (0) Thanks(0)   Quote gnome power Quote  Post ReplyReply Direct Link To This Post Posted: 16 March 2012 at 8:42am
Originally posted by Drax Drax wrote:

That's seriously nifty, GP. Innovative and very nicely put together, by the looks of it. Clap

I'm assuming the hp, mana and xp bars update with each new prompt. How often does the bar for the tick timer update?

Thanks, Drax. :)

The tick-timer counts down automatically in increments of 0.1 seconds.
Back to Top
Hedmric View Drop Down
Private
Private
Avatar

Joined: 29 January 2012
Location: Ontario, Canada
Status: Offline
Points: 55
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hedmric Quote  Post ReplyReply Direct Link To This Post Posted: 16 March 2012 at 10:20am
I have the ubuntu/linux version of mudlet.  It should work the same eh?

Back to Top
Ardath View Drop Down
Corporal
Corporal
Avatar

Joined: 14 November 2009
Status: Offline
Points: 373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ardath Quote  Post ReplyReply Direct Link To This Post Posted: 16 March 2012 at 10:42am
I'm not about to put my battles off to the side like that, and I made a similar health thing that is smaller...  there must be a better way to send this to someone than posting 7 pages of Lua?  My capture windows aren't tabbed - theres just 1 for channels, 1 for tell/gtells below it.  No need to ever fiddle with it ever again unless you want to scroll up or resize the windows - those tabs got in the way when I used that script.  Good luck using Mudlet, the input bar is not as usable for some features as the CMud one.


Edited by Ardath - 16 March 2012 at 10:45am
It is easier for people to read your logs if you would end your prompt with "%c"
Back to Top
gnome power View Drop Down
First Sergeant
First Sergeant
Avatar
Fear my graphs!

Joined: 02 July 2003
Location: United States
Status: Offline
Points: 11241
Post Options Post Options   Thanks (0) Thanks(0)   Quote gnome power Quote  Post ReplyReply Direct Link To This Post Posted: 16 March 2012 at 11:15am
I've got some ideas for the tabs down the line.  Might want to put a character sheet in one, a control panel for my scripts (when they get more complicated and need on/off toggles) in another, etc.  The combat spam was actually a requested feature because people were saying they needed to see the flow of spam to get a sense of if they just got ambushed or something.  I like it there, personally, but to each his own.  I can make it togglable if there's interest in that.

There's  an xml exporter but when I tried using others posted here, they didn't work, so that's why I did it this way. If someone knows the secret to getting xml files off these forums to work, that would be great.
Back to Top
Jeckyl View Drop Down
Sergeant First Class
Sergeant First Class
Avatar

Joined: 24 August 2011
Location: MN
Status: Offline
Points: 2503
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jeckyl Quote  Post ReplyReply Direct Link To This Post Posted: 16 March 2012 at 11:56am
Try doing an export, and host the resulting file somewhere, and provide a link to the file(s) for download. Might be easier? If you need a place to host, I can take care of that. At the very least, we can figure out how it works, and if its feasible.
<-- This is what happens when you try to pk with the Illuminati.

--

If we changed everything that everyone whined about, DSL would be a kitten paradise and there would be minutely copyovers. -Bioteq
Back to Top
gnome power View Drop Down
First Sergeant
First Sergeant
Avatar
Fear my graphs!

Joined: 02 July 2003
Location: United States
Status: Offline
Points: 11241
Post Options Post Options   Thanks (0) Thanks(0)   Quote gnome power Quote  Post ReplyReply Direct Link To This Post Posted: 16 March 2012 at 12:04pm
Yeah, that's doable. Github?
Back to Top
Jeckyl View Drop Down
Sergeant First Class
Sergeant First Class
Avatar

Joined: 24 August 2011
Location: MN
Status: Offline
Points: 2503
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jeckyl Quote  Post ReplyReply Direct Link To This Post Posted: 16 March 2012 at 1:07pm
Sure, if that's where you want to put it. I have my own hosting account, and wouldn't mind hosting it there...I've been thinking about setting up a subdomain and site for dsl related stuffs. Either way works for me. I'll reset my mudlet stuff this weekend, and try to import it if you can export it.
<-- This is what happens when you try to pk with the Illuminati.

--

If we changed everything that everyone whined about, DSL would be a kitten paradise and there would be minutely copyovers. -Bioteq
Back to Top
Hedmric View Drop Down
Private
Private
Avatar

Joined: 29 January 2012
Location: Ontario, Canada
Status: Offline
Points: 55
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hedmric Quote  Post ReplyReply Direct Link To This Post Posted: 17 March 2012 at 7:05pm
I've copy and pasted everything you had here as per the instructions, but i'm not seeing any text.  My gauges are up, showing all my info and the tick timer is working...I just can't see anything..

What am I doing wrong?  Is there something else I have to do to get my windows sized correctly?
Back to Top
 Post Reply Post Reply Page  123>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 10.17
Copyright ©2001-2013 Web Wiz Ltd.