User Tools

Site Tools


testo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
testo [2014/06/20 19:04] vodurtesto [2015/01/31 05:31] (current) vodur
Line 1: Line 1:
-Properties +start_con_handler( descriptor, func, … ) 
-<sortable 1> + 
-^Field^Get^Set^ +Creates a coroutine of the given function and sets it as the con state handler to the target descriptorAny additional arguments to start_con_handler are passed to func when it is calledThe con state handler handles all player input from the given descriptorEntered commands are accessed within the handler function through coroutine.yield()
-| [[.str|str]] | 0 | 5 | + 
-| [[.class|class]] | 0 |  | +The general logic is thus: start_con_handler creates a coroutine of func func coroutine is set as descriptor's con state handler func coroutine is resumed, passing any additional start_con_handler arguments as arguments to func if coroutine.yield() is called inside the handler, then the coroutine will suspend until the player enters a command, at which time the handler function resumes, with the return value of coroutine.yield() being the command that was enteredIf/when the handler function returns, descriptor's con state handler is cleared and con state is set back to "playing"The player can now enter normal game commands again
-| [[.fighting|fighting]] | 0 |  | + 
-| [[.affects|affects]] | 0 |  | +Example 1: confirming an action (example uses luai for convenience) 
-| [[.dex|dex]] | 0 | 5 | + 
-| [[.level|level]] | 0 | 5 | +<code> 
-| [[.size|size]] | 0 | 5 | +luai 
-| [[.move|move]] | 0 | 5 | +lua> 
-| [[.hitroll|hitroll]] | 0 | 5 | + 
-| [[.damtype|damtype]] | 0 |  | +adssd 
-| [[.sex|sex]] | 0 | 5 | +</code> 
-| [[.himher|himher]] | 0 |  | + 
-| [[.silver|silver]] | 0 | 5 | +<code lua> 
-| [[.pkdeaths|pkdeaths]] | 0 |  | +for i=1,2000 do 
-| [[.ischarm|ischarm]] | 0 |  | + say('hi') 
-| [[.isneutral|isneutral]] | 0 |  | +end 
-| [[.vit|vit]] | 0 | 5 | + 
-| [[.clan|clan]] | 0 |  | +for i=30,3000 do 
-| [[.cha|cha]] | 0 | 5 | +    blah("stuff") 
-| [[.mobkills|mobkills]] | 0 |  | +end 
-| [[.isimmort|isimmort]] | 0 |  | +</code> 
-| [[.heshe|heshe]] | 0 |  | + 
-| [[.clanrank|clanrank]] | 0 |  | +<code lua> 
-| [[.luc|luc]] | 0 | 5 | +do 
-| [[.description|description]] | 0 | 5 | + 
-| [[.scroll|scroll]] | 0 |  | +local function confirm_handler( ch ) 
-| [[.explored|explored]] | 0 |  | +    sendtochar(ch, "Are you sure you want to declare yourself a butthead? [Y/n]\n\r") 
-| [[.beheads|beheads]] | 0 |  | + 
-| [[.bank|bank]] | 0 |  | +    while true do 
-| [[.questpoints|questpoints]] | 0 |  | +        local cmd=coroutine.yield() 
-| [[.proto|proto]] | 0 |  | + 
-| [[.isfollow|isfollow]] | 0 |  | +        if cmd=="Y" then 
-| [[.align|align]] | 0 | 5 | +            ch:mdo("gossip I AM BUTTHEAD") 
-| [[.maxmana|maxmana]] | 0 | 5 | +            return 
-| [[.groupsize|groupsize]] | 0 |  | +        elseif cmd=="n" then 
-[[.ingame|ingame]] | 0 |  | +            sendtochar(ch, "Fine, don't then.\n\r") 
-| [[.dis|dis]] | 0 | 5 | +            return 
-| [[.position|position]] | 0 |  | +        else 
-| [[.pkills|pkills]] | 0 |  | +            sendtochar(ch, "Invalid! Please input {GY{x or {rn{x.\n\r") 
-| [[.longdescr|longdescr]] | 0 | 5 | +        end 
-| [[.isevil|isevil]] | 0 |  | +    end 
-| [[.shortdescr|shortdescr]] | 0 | 5 | +end 
-| [[.vnum|vnum]] | 0 |  | + 
-| [[.mana|mana]] | 0 | 5 | +start_con_handler( mob.descriptor, confirm_handler, mob ) 
-| [[.hp|hp]] | 0 | 5 | + 
-| [[.wis|wis]] | 0 | 5 | +end 
-| [[.mobdeaths|mobdeaths]] | 0 |  | +</code
-| [[.con|con]] | 0 | 5 | + 
-| [[.int|int]] | 0 | 5 | +<code
-| [[.race|race]] | 0 | 5 | +Are you sure you want to declare yourself a butthead? [Y/n
-| [[.isactive|isactive]] | 0 |  | +Y 
-| [[.maxmove|maxmove]] | 0 | 5 | +You gossip 'I AM BUTTHEAD' 
-| [[.isgood|isgood]] | 0 |  | +lua> 
-| [[.achpoints|achpoints]] | 0 |  | +</code> 
-| [[.inventory|inventory]] | 0 |  | + 
-| [[.ispc|ispc]] | 0 |  | +See also [[:lua:scripting:examples:constates|constates]]
-| [[.remorts|remorts]] | 0 |  | +
-| [[.money|money]] | 0 |  | +
-| [[.hisher|hisher]] | 0 |  | +
-| [[.maxhp|maxhp]] | 0 | 5 | +
-| [[.agi|agi]] | 0 | 5 | +
-| [[.pet|pet]] | 0 | 5 | +
-| [[.name|name]] | 0 | 5 | +
-| [[.room|room]] | 0 |  | +
-| [[.attacktype|attacktype]] | 0 | 5 | +
-| [[.isnpc|isnpc]] | 0 |  | +
-| [[.damnoun|damnoun]] | 0 |  | +
-| [[.gold|gold]] | 0 | 5 | +
-| [[.damroll|damroll]] | 0 | 5 | +
-| [[.stance|stance]] | 0 |  | +
-</sortable+
-Methods +
-<sortable 1+
-^Method^Security^ +
-[[.mobhere|mobhere]] | 0 | +
-| [[.objhere|objhere]] | 0 | +
-| [[.mobexists|mobexists]] | 0 | +
-| [[.objexists|objexists]] | 0 | +
-| [[.affected|affected]] | 0 | +
-| [[.act|act]] | 0 | +
-[[.offensive|offensive]] | 0 | +
-| [[.immune|immune]] | 0 | +
-| [[.carries|carries]] | 0 | +
-| [[.wears|wears]] | 0 | +
-| [[.has|has]] | 0 | +
-| [[.uses|uses]] | 0 | +
-| [[.qstatus|qstatus]] | 0 | +
-| [[.resist|resist]] | 0 | +
-| [[.vuln|vuln]] | 0 | +
-| [[.skilled|skilled]] | 0 | +
-| [[.ccarries|ccarries]] | 0 | +
-| [[.qtimer|qtimer]] | 0 | +
-| [[.cansee|cansee]] | 0 | +
-| [[.canattack|canattack]] | 0 | +
-| [[.destroy|destroy]] | 1 | +
-[Hit Return to continue]+
  
-| [[.oload|oload]] | 1 | 
-| [[.say|say]] | 1 | 
-| [[.emote|emote]] | 1 | 
-| [[.mdo|mdo]] | 1 | 
-| [[.tell|tell]] | 1 | 
-| [[.asound|asound]] | 1 | 
-| [[.gecho|gecho]] | 1 | 
-| [[.zecho|zecho]] | 1 | 
-| [[.kill|kill]] | 1 | 
-| [[.assist|assist]] | 1 | 
-| [[.junk|junk]] | 1 | 
-| [[.echo|echo]] | 1 | 
-| [[.mload|mload]] | 1 | 
-| [[.purge|purge]] | 1 | 
-| [[.goto|goto]] | 1 | 
-| [[.at|at]] | 1 | 
-| [[.otransfer|otransfer]] | 1 | 
-| [[.force|force]] | 1 | 
-| [[.gforce|gforce]] | 1 | 
-| [[.vforce|vforce]] | 1 | 
-| [[.cast|cast]] | 1 | 
-| [[.damage|damage]] | 1 | 
-| [[.remove|remove]] | 1 | 
-| [[.remort|remort]] | 1 | 
-| [[.qset|qset]] | 1 | 
-| [[.qadvance|qadvance]] | 1 | 
-| [[.reward|reward]] | 1 | 
-| [[.peace|peace]] | 1 | 
-| [[.restore|restore]] | 1 | 
-| [[.setact|setact]] | 1 | 
-| [[.setvuln|setvuln]] | 1 | 
-| [[.setimmune|setimmune]] | 1 | 
-| [[.setresist|setresist]] | 1 | 
-| [[.hit|hit]] | 1 | 
-| [[.randchar|randchar]] | 0 | 
-| [[.loadprog|loadprog]] | 1 | 
-| [[.loadscript|loadscript]] | 1 | 
-| [[.loadstring|loadstring]] | 1 | 
-| [[.loadfunction|loadfunction]] | 1 | 
-| [[.savetbl|savetbl]] | 1 | 
-| [[.loadtbl|loadtbl]] | 1 | 
-| [[.tprint|tprint]] | 1 | 
-| [[.olc|olc]] | 1 | 
-| [[.delay|delay]] | 1 | 
-| [[.cancel|cancel]] | 1 | 
-| [[.setval|setval]] | 1 | 
-| [[.getval|getval]] | 1 | 
-| [[.rvnum|rvnum]] | 0 | 
-| [[.describe|describe]] | 1 | 
-| [[.addaffect|addaffect]] | 9 | 
-| [[.removeaffect|removeaffect]] | 9 | 
-</sortable> 
testo.1403291065.txt.gz · Last modified: 2014/06/20 19:04 by vodur