lua:scripting:examples:constates
This is an old revision of the document!
do local function menu_handler( ch ) sendtochar(ch, "Beginning the menu test.\n\r") while true do sendtochar( ch, [[ [s]ex [r]ace [c]lass [q]uit ]]) local cmd=coroutine.yield() if cmd=="s" then sendtochar( ch, "Your sex: "..ch.sex.."\n\r") elseif cmd=="r" then sendtochar( ch, "Your race: "..ch.race.."\n\r") elseif cmd=="c" then sendtochar( ch, "Your class: "..ch.class.."\n\r") elseif cmd=="q" then return -- ends the con handler else sendtochar( "Unknown selection: "..cmd.."\n\r") end end end start_con_handler( mob.descriptor, menu_handler, mob ) end
lua/scripting/examples/constates.1422424651.txt.gz · Last modified: 2015/01/28 05:57 by vodur