Aetolia Forums: Neat Little Scripts - Aetolia Forums

Jump to content

  • (46 Pages)
  • +
  • « First
  • 44
  • 45
  • 46

Neat Little Scripts Awww, so cute

#901 User offline   Lanira Icon

  • Teacher of the Rhythm
  • PipPipPipPipPipPipPip
  • Group: Aetolians
  • Posts: 512
  • Joined: 22-March 09
  • Gender:Female
  • Location:S. OR.

Posted 22 July 2010 - 08:48 AM

Set theory functions:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <func name="set_compliment" copy="yes">
	<value>#LOCAL $compliment
#FORALL $b {
  #IF (!%ismember( %i, $a)) {
	#ADDITEM $compliment %i
	}
  }
#RETURN $compliment</value>
	<arglist>$a, $b</arglist>
  </func>
  <func name="set_difference" copy="yes">
	<value>#LOCAL $difference
#FORALL $a {
  #IF (!%ismember( %i, $b)) {
	#ADDITEM $difference %i
	}
  }
#FORALL $b {
  #IF (!%ismember( %i, $a)) {
	#ADDITEM $difference %i
	}
  }
#RETURN $difference</value>
	<arglist>$a, $b</arglist>
  </func>
  <func name="set_intersection" copy="yes">
	<value>#LOCAL $intersection
#FORALL $a {
  #IF (%ismember( %i, $b)) {
	#ADDITEM $intersection %i
	}
  }
#RETURN $intersection</value>
	<arglist>$a, $b</arglist>
  </func>
  <func name="set_union" copy="yes">
	<value>#LOCAL $union
#FORALL $a {
  #ADDITEM $union %i
  }
#FORALL $b {
  #ADDITEM $union %i
  }
#RETURN $union</value>
	<arglist>$a, $b</arglist>
  </func>
</cmud>

In sleep he sang to me; In dreams he came.
That voice which calls to me, and speaks my name
0

#902 User offline   Ezrax Icon

  • Explorer of Mysteries
  • PipPipPipPipPipPipPipPipPip
  • Group: Aetolians
  • Posts: 3,600
  • Joined: 21-November 04
  • Gender:Male
  • Location:Mudsexxin' the harem.

Posted 22 July 2010 - 10:14 AM

Mine's prettier:

function check_defences( cmd )
	local def_start
	if ( last_command == "def" or last_command == "defences" ) then
		for line = 1, mb.nr_of_lines do
			if mb.lines[line] == "You have the following active defences:" then
				--sdebug( "Defline is being seen." )
				for k, v in pairs( def ) do
					if v.defline then
						--sdebug( "Defline is being discovered." )
						v.affirm = false
					end
				end
			end
		def_start = line
			break
		end
		
		if not def_start then
		return
		end
		
		for line = def_start + 1, mb.nr_of_lines do
			for k, v in pairs( def ) do
				if v.defline ~= nil and cmp(v.defline, mb.lines[line]) then
					--sdebug( tostring( v.defline ) .. " compared to " .. tostring( mb.lines[line] ) ) -- Working
					v.affirm = true
					suffix( line, C.c .. ' (' .. ( v.name ) .. C.c .. ')' .. C.x )
				end
			end
		end
	end
end

Posted Image

<rafic
0

#903 User offline   Rinata Icon

  • Resident lazy, flaky trap.
  • PipPipPipPipPipPipPipPipPip
  • Group: Aetolians
  • Posts: 2,610
  • Joined: 08-January 07
  • Gender:Male
  • Location:Chicago!

Posted 22 July 2010 - 07:29 PM

Keep track of those pesky Enorian militia with neon green highlights!
/def -q -Fp10 -mregexp -h"SEND ^mwho enorian active$" CheckingEnorian = /set checkingEnorian=2%;/quote -S /undeflast `"/list -mregexp -s ActiveMilitiaHighlight"
/def undeflast = /undef $(/last %*)
/def -E(%checkingEnorian) -mregexp -t"^Recruit:$" RecruitsEndIt = /set checkingEnorian=1
/def -mregexp -t"^((\w+)(, |))+$" CaptureNames = /if (%checkingEnorian) /parselist $[replace(",","",%*)]%;/if (%checkingEnorian == 1) /unset checkingEnorian%;/endif%;/endif

/def parselist = /while (%#) /def -mregexp -Fp10 -PBCgreen -t"%1" %{1}ActiveMilitiaHighlight%;/shift%;/done

Do you ever look at the clock and wish it were nine o'clock on a saturday; That the regular crowd would shuffle in; That the old man sitting next to you would stop making love to his tonic and gin?

Oh, and I'd like to make this clear. I'm a guy. Feel free to refer to me as Seurimas, my current character, or Nick, hi!
0

#904 User offline   Amias Icon

  • Lleisian Scholar
  • PipPipPipPipPipPip
  • Group: Aetolians
  • Posts: 496
  • Joined: 23-June 10
  • Gender:Male
  • Location:United Kingdom.

Posted 22 July 2010 - 07:50 PM

Stop! It burnses! It burnses!

/tf_rant
Vote for Aetolia!

Posted Image
-----------------------------------------------------------------------------------------------------------------------

I would love to change the world, but they won't give me the source code.


0

#905 User offline   Naamah Icon

  • Definition of Valor
  • PipPipPipPipPip
  • Group: Aetolians
  • Posts: 216
  • Joined: 07-January 09
  • Gender:Female
  • Location:Deep within the Death Caves

Posted 22 July 2010 - 08:06 PM

Or you could always just do "CONFIG COLOR ACTIVE #". And then there's no need for crazy highlight capture triggers.
Posted Image
0

#906 User offline   Amias Icon

  • Lleisian Scholar
  • PipPipPipPipPipPip
  • Group: Aetolians
  • Posts: 496
  • Joined: 23-June 10
  • Gender:Male
  • Location:United Kingdom.

Posted 22 July 2010 - 08:12 PM

View PostNaamah, on Jul 22 2010, 09:06 PM, said:

Or you could always just do "CONFIG COLOR ACTIVE #". And then there's no need for crazy highlight capture triggers.


*snicker*
Vote for Aetolia!

Posted Image
-----------------------------------------------------------------------------------------------------------------------

I would love to change the world, but they won't give me the source code.


0

#907 User offline   Rinata Icon

  • Resident lazy, flaky trap.
  • PipPipPipPipPipPipPipPipPip
  • Group: Aetolians
  • Posts: 2,610
  • Joined: 08-January 07
  • Gender:Male
  • Location:Chicago!

Posted 22 July 2010 - 08:13 PM

View PostNaamah, on Jul 22 2010, 03:06 PM, said:

Or you could always just do "CONFIG COLOR ACTIVE #". And then there's no need for crazy highlight capture triggers.

So you can. Alas, it can be adapted to any list of names easily enough. :P

Also, this way SCENT is neon green too, so I don't have to do WHO, scan the list, OMG, that's by me! Runaway!
Do you ever look at the clock and wish it were nine o'clock on a saturday; That the regular crowd would shuffle in; That the old man sitting next to you would stop making love to his tonic and gin?

Oh, and I'd like to make this clear. I'm a guy. Feel free to refer to me as Seurimas, my current character, or Nick, hi!
0

#908 User offline   Naamah Icon

  • Definition of Valor
  • PipPipPipPipPip
  • Group: Aetolians
  • Posts: 216
  • Joined: 07-January 09
  • Gender:Female
  • Location:Deep within the Death Caves

Posted 23 July 2010 - 03:54 AM

The scent and adaptability are fair points. I rescind approximately half the snark used in my previous post.
Posted Image
0

#909 User offline   Rinata Icon

  • Resident lazy, flaky trap.
  • PipPipPipPipPipPipPipPipPip
  • Group: Aetolians
  • Posts: 2,610
  • Joined: 08-January 07
  • Gender:Male
  • Location:Chicago!

Posted 24 July 2010 - 05:54 AM

Case and point: Adapted to warn to wholist movements:

/def -q -Fp10 -mregexp -h"SEND ^mwho enorian active$" CheckingEnorian = /set checkingEnorian=2%;/quote -S /undeflast `"/list -mregexp -s ActiveMilitiaTracker"
/def undeflast = /undef $(/last %*)
/def -E(%checkingEnorian) -mregexp -t"^Recruit:$" RecruitsEndIt = /set checkingEnorian=1
/def -mregexp -t"^((\w+)(, |))+$" CaptureNames = /if (%checkingEnorian) /parselist $[replace(",","",%*)]%;/if (%checkingEnorian == 1) /unset checkingEnorian%;/endif%;/endif

/def parselist = /while (%#) \
/def -mregexp -Fp10 -t"^( +)%1 - (.{24})(.{10})" %{1}ActiveMilitiaTracker = /set curLKP=$$[textencode(%%P2)]%%;/if (%%_Aet_%{1}_lkp !/ %%curLKP) /echo -aBCblue [ %1 moved from $$[textdecode(%%_Aet_%{1}_lkp)] to $$[textdecode(%%curLKP)] ]%%;/set _Aet_%{1}_lkp=%%curLKP%%;/endif%;/shift%;/done

Do you ever look at the clock and wish it were nine o'clock on a saturday; That the regular crowd would shuffle in; That the old man sitting next to you would stop making love to his tonic and gin?

Oh, and I'd like to make this clear. I'm a guy. Feel free to refer to me as Seurimas, my current character, or Nick, hi!
0

#910 User offline   Amias Icon

  • Lleisian Scholar
  • PipPipPipPipPipPip
  • Group: Aetolians
  • Posts: 496
  • Joined: 23-June 10
  • Gender:Male
  • Location:United Kingdom.

Posted 24 July 2010 - 07:05 AM

Oooh. Now it is starting to get interesting.

*opens up a shell*
Vote for Aetolia!

Posted Image
-----------------------------------------------------------------------------------------------------------------------

I would love to change the world, but they won't give me the source code.


0

#911 User offline   Glasse Icon

  • Demolition Ghost
  • PipPipPipPipPipPipPip
  • Group: Aetolians
  • Posts: 754
  • Joined: 03-July 10
  • Gender:Not Telling
  • Location:El'jazira, and the Beryl Sea.

Posted 04 August 2010 - 12:42 AM

Here's a real simple one for Mudlet: An alias that makes emotes a little more natural feeling.

Name: Improved Emotes
Pattern: ^(.*)\<me\>(.*)$

Script:

if matches[2] == "" then
	send("em " .. matches[3])
else
	send("em \(" .. matches[2] .. "\) " .. matches[3])
end


Now, you can emote a little more flexibly with the command <me>.

Quote

With a loud crash, <me> tumbles down from the treetops above
You have emoted: With a loud crash, Lin tumbles down from the treetops above.

"Absolutely not," <me> says
You have emoted: "Absolutely not," Lin says.

<me> can still do good ol'-fashioned emotes this way
You have emoted: Lin can still do good ol'-fashioned emotes this way.

Posted Image
0

#912 User offline   Rinata Icon

  • Resident lazy, flaky trap.
  • PipPipPipPipPipPipPipPipPip
  • Group: Aetolians
  • Posts: 2,610
  • Joined: 08-January 07
  • Gender:Male
  • Location:Chicago!

Posted 23 August 2010 - 01:59 AM

Learned remaining fancifier!
From:

Quote

You have learnt the following lessons:
It will take you 1764 more lessons to transcend Vision.
It will take you 1764 more lessons to transcend Reanimation.
It will take you 1764 more lessons to transcend Avoidance.
It will take you 705 more lessons to transcend Constitution.
It will take you 705 more lessons to transcend Thermology.
It will take you 705 more lessons to transcend Frost.
It will take you 705 more lessons to transcend Antidotes.
It will take you 705 more lessons to transcend Fitness.
It will take you 705 more lessons to transcend Galvanism.
It will take you 705 more lessons to transcend Philosophy.
It will take you 1764 more lessons to transcend Tattoos.
It will take you 1758 more lessons to transcend Survival.
It will take you 1764 more lessons to transcend Weaponry.
It will take you 705 more lessons to transcend Horsemanship.

To:
Skill             Lessons   Credits (8.5)  Bound (6) Daily Lessons (5)
----------------------------------------------------------------------
Vision              1764            207        294         352
Reanimation         1764            207        294         352
Avoidance           1764            207        294         352
Constitution         705             82        117         141
Thermology           705             82        117         141
Frost                705             82        117         141
Antidotes            705             82        117         141
Fitness              705             82        117         141
Galvanism            705             82        117         141
Philosophy           705             82        117         141
Tattoos             1764            207        294         352
Survival            1758            206        293         351
Weaponry            1764            207        294         352
Horsemanship         705             82        117         141


/def -Fp8 -ag -mregexp -t"^You have learnt the following lessons:" LearnedStart = \
/echo -aBCblue   Skill             Lessons   Credits (8.5)  Bound (6) Daily Lessons (5)%;\
/echo -aBCcyan -- ----------------------------------------------------------------------
/def -Fp10 -ag -mregexp -t"^It will take you (\d+) more lessons to transcend (\w+).$" LearnedtoTranscend = \
/let skill=$[strip_attr(%P2)]%;/let lessons=$[strip_attr(%P1)]%;/let credits=$[lessons / 8.5]%;/let bound=$[lessons / 6]%;/let daily=$[lessons / 5]%;\
/let credits=$[nodecimal(credits)]%;\
/echo -aBCyellow -- $[pad(skill,-14)]$[pad(lessons,10)]$[pad(credits,15)]$[pad(bound,11)]$[pad(daily,12)]
/def -Fp10 -ag -mregexp -t"^You have learned (\d+) lessons in (\w+).$" LearnedTotal = \
/trigger It will take you %P1 more lessons to transcend %P2.

/def nodecimal = /return $[substr(%*,0,((strrchr(%*,".") + 1) ? : 3) - 1)]

Do you ever look at the clock and wish it were nine o'clock on a saturday; That the regular crowd would shuffle in; That the old man sitting next to you would stop making love to his tonic and gin?

Oh, and I'd like to make this clear. I'm a guy. Feel free to refer to me as Seurimas, my current character, or Nick, hi!
0

#913 User offline   Darliea Icon

  • I AM NOT A DEN MOTHER.
  • PipPipPipPipPipPipPipPipPip
  • Group: Aetolians
  • Posts: 2,960
  • Joined: 29-January 07
  • Gender:Female
  • Location:Houston, Texas USA

Posted 23 August 2010 - 03:02 AM

Shiny!
Posted Image

Chantel is complete win and very patient.
0

#914 User offline   Rinata Icon

  • Resident lazy, flaky trap.
  • PipPipPipPipPipPipPipPipPip
  • Group: Aetolians
  • Posts: 2,610
  • Joined: 08-January 07
  • Gender:Male
  • Location:Chicago!

Posted 23 August 2010 - 04:34 AM

So it's been a long, boring, coding productive day.
Bashing highlighter:
To the best of its ability, it will turn this:

Quote

Down the mining tunnel. (Azdun dungeon.)
There are 2 wickedly sharp stalagmites here. A slave strains and grunts as it tries to push a cart of ore by you.
You see exits leading south and northwest.

:
You can see the following 3 objects:
"stalagmites170911" wickedly sharp stalagmites.
"stalagmites189287" wickedly sharp stalagmites.
"kobold42894" a kobold slave.
:

Into this:

Quote

[ +*+ Neuromancer +*+ : Targetting: slave ]
Down the mining tunnel. (Azdun dungeon.)
There are 2 wickedly sharp stalagmites here. A slave strains and grunts as it tries to push a cart of ore by you.
You see exits leading south and northwest.

:
You can see the following 3 objects:
"stalagmites170911" wickedly sharp stalagmites.
"stalagmites189287" wickedly sharp stalagmites.
"kobold42894" a kobold slave.
:

Extensible to include other things or things which don't match the primitive regexp I use, if you so choose. Using <targ>_room variables, just add a LOOK description (or more, separated by '|') and it'll highlight that as well. Can only highlight one of each targ pattern in a look line. Requires wrapwidth 0. (Which is to say it won't match whole sentences/room descs if it's not.)

/require textencode.tf
/def btarg = /if (%# = 0) /newbtarg%;/return 0%;/endif%;\
/newbtarg%;\
/set bashTargs=%*%;/foreach i bashTargs /buildBashTarg %%i%;/sysmessage Targetting: %bashTargs

/def -Fp10 -mregexp -t"^You can see the following (\d+) objects.$" GatherIHBtarg = /set _IH=1
/def -E(_IH) -mregexp -t"^(.*)$" CatchAllUntilNotCatching = \
/if (!regmatch("^\"(\w+)(\d+)\"( +)(.*)\.$",%*)) \
; It isn't an IH line, so end IH
     /set _IH=0%;\
/endif

/def newbtarg = /foreach i rTrigs /undef %%i%;/foreach i iTrigs /undef %%i%;/unset rTrigs%;/unset iTrigs

/def buildBashTarg = \
/set rTrigs=%rTrigs rTrig%1%;\
; Room trigs list ^
/set iTrigs=%iTrigs iTrig%1%;\
; IH trigs list ^
/if (get_val(textencode(%1),"_room") !/ "") /set otherROOM=|$[get_val(textencode(%1),"_ih")]%;/else /set otherROOM=%;/endif%;\
/def -mregexp -PBCgreen -Fp10 -t"(?i)(^|\\. +)(There are (\\d+)[^.]\{0,%preLim1\}%{1}[^.]\{0,%postLim1\} here|[^.]\{0,%preLim2\}%1[^.]\{0,%postLim2\}\\.%{otherROOM})($$| )" rTrig%1%;\
/def -E(_IH) -mregexp -PBCgreen -Fp10 -t"(?i)^(\\"%1(\\d+)\\"|\\"(\\w+)(\\d+)\\"( +).*%1.*\\.%{otherIH})" iTrig%1 = /

/def sysMessage = /echo -p @{Cblue}[@{Ccyan} @{Cred}+*+@{Ccyan} Neuromancer @{Cred}+*+@{Ccyan} @{Cblue}:@{BCblue} %*@{n} @{Cblue}]

/def -i get_val= /return %1%2%3%4%5%6%7%8%9%10

/set ivoln_room=Erupting from the ground and engulfed by a funnel of sand and stray earth, a lesser, clay status of a wyrm thrusts upwards, an ebon egg clutched in its maw.
/set skt_39_all_room=Proud and tall, Skt\'all the ophidian chieftain stands here.

/set preLim2=20
/set postLim2=40
/set preLim1=20
/set postLim1=20


Usage:
/btarg <targets> [<more targets> [...]]

preLim1, postLim1 are limits to how many characters can be matched before and after the target in a grouped room, while preLim2 and postLim2 are the same for when there's just one.

All triggers here are caseless, so you needn't worry about Horkval or horkval for example.

EDIT: After a bit of testing, I can say, without a shred of modesty, that this actually works really nice :D
Do you ever look at the clock and wish it were nine o'clock on a saturday; That the regular crowd would shuffle in; That the old man sitting next to you would stop making love to his tonic and gin?

Oh, and I'd like to make this clear. I'm a guy. Feel free to refer to me as Seurimas, my current character, or Nick, hi!
0

#915 User offline   Ezrax Icon

  • Explorer of Mysteries
  • PipPipPipPipPipPipPipPipPip
  • Group: Aetolians
  • Posts: 3,600
  • Joined: 21-November 04
  • Gender:Male
  • Location:Mudsexxin' the harem.

Posted 23 August 2010 - 12:31 PM

I just finished reading Neuromancer. I think I need to read it again. I HAVE NO IDEA WHAT WAS GOING ON.
Posted Image

<rafic
0

#916 User offline   Rinata Icon

  • Resident lazy, flaky trap.
  • PipPipPipPipPipPipPipPipPip
  • Group: Aetolians
  • Posts: 2,610
  • Joined: 08-January 07
  • Gender:Male
  • Location:Chicago!

Posted 23 August 2010 - 07:02 PM

View PostEzrax, on 23 August 2010 - 12:31 PM, said:

I just finished reading Neuromancer. I think I need to read it again. I HAVE NO IDEA WHAT WAS GOING ON.

Besides PURE AWESOME, nothing much.
Do you ever look at the clock and wish it were nine o'clock on a saturday; That the regular crowd would shuffle in; That the old man sitting next to you would stop making love to his tonic and gin?

Oh, and I'd like to make this clear. I'm a guy. Feel free to refer to me as Seurimas, my current character, or Nick, hi!
0

#917 User offline   Glasse Icon

  • Demolition Ghost
  • PipPipPipPipPipPipPip
  • Group: Aetolians
  • Posts: 754
  • Joined: 03-July 10
  • Gender:Not Telling
  • Location:El'jazira, and the Beryl Sea.

Posted 23 August 2010 - 07:44 PM

Main character does a ton of drugs, has lol randum sex with a razorgirl, and then suddenly some crazy Jamaican dude is blowing things away with a sawed-off shotgun.

I probably owe it a reread again, too. XD
Posted Image
0

#918 User offline   Aishia Icon

  • Proponent of Change
  • PipPipPipPip
  • Group: Aetolians
  • Posts: 159
  • Joined: 01-November 09
  • Gender:Female
  • Location:The Frozen North.

Posted 23 August 2010 - 09:13 PM

Gibson is one of my favorite authors >_>
Posted Image
OmgChantel<3
Say things about me.
0

Share this topic:


  • (46 Pages)
  • +
  • « First
  • 44
  • 45
  • 46


Fast Reply

  

Icon1 User(s) are reading this topic (0 members, 1 guests, 0 anonymous users)


Font:
Arial | Calibri | Lucida Console | Verdana
 
Font Size:
9px | 10px | 11px | 12px | 10pt | 12pt
 
Color: