The MudMagic Python script engine is nothing more than a gateway to your local Python install. As of version 1.9 of this software, Python support is now built-in with the software. To use Python in your aliases or triggers, simply select PYTHON as the command, and input your python script.
send() sends data back to the client messagebox() creates a popup message box |
one = _1 two = _2 send("say First was: "+one+" Second was: "+two) |
2. Example provided by Davion
Alias: ^c (.*) (.*)
#Grab the arguments! attempt = _1 target = _2 #Build us some spells! spellList = ("fs", "firestorm"), ("fb", "fireball"), ("sc", "sex change") #A simple function to cycle the spellList def getSpell(sn): for x,y in spellList: if sn == x: return y return None #Grab the spell to cast spell = getSpell(attempt) #Lets see if it was found! if spell: send("cast '"+spell+"' "+target) else: messagebox("You don't know the "+attempt+" spell!") |