lua:scripting:examples:qtimerluavals
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| lua:scripting:examples:qtimerluavals [2014/12/31 22:18] – vodur | lua:scripting:examples:qtimerluavals [2026/10/13 21:02] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Original ====== | ||
| - | |||
| - | <code lua>-- Kain GRALL code for sack of rice | ||
| - | say(" | ||
| - | emote(" | ||
| - | -- Kain greet code to start quest | ||
| - | local ricevnum=7326 | ||
| - | local qvnum=14800 | ||
| - | -- Don't give quest if timer is still running | ||
| - | if ch: | ||
| - | say(" | ||
| - | return | ||
| - | end | ||
| - | -- Don't talk them if already gave something | ||
| - | tracker=tracker or {} | ||
| - | if tracker[ch.name] then return end | ||
| - | |||
| - | say(" | ||
| - | ch.name, | ||
| - | getobjproto(ricevnum).shortdescr) | ||
| - | -- End Kain greet code | ||
| - | </ | ||
| - | |||
| - | <code lua>-- Kain give code | ||
| - | local ricevnum=7326 | ||
| - | local qvnum=14800 | ||
| - | |||
| - | -- Does he want it? | ||
| - | if not(obj1.vnum==ricevnum) then | ||
| - | say("I don't want this." | ||
| - | </ | ||
| - | |||
| - | ===== With luavals ===== | ||
| - | |||
| - | <code lua>-- Kain GRALL code for sack of rice | ||
| - | say(" | ||
| - | -- Kain greet code to start quest | ||
| - | local ricevnum=7326 | ||
| - | -- Don't give quest if timer is still running | ||
| - | local time_current=os.time() | ||
| - | local time_quest=ch: | ||
| - | if time_quest> | ||
| - | say(" | ||
| - | return | ||
| - | end | ||
| - | -- Don't talk them if already gave something | ||
| - | tracker=tracker or {} | ||
| - | if tracker[ch.name] then return end | ||
| - | |||
| - | say(" | ||
| - | ch.name, | ||
| - | getobjproto(ricevnum).shortdescr) | ||
| - | -- End Kain greet code | ||
| - | </ | ||
| - | |||
| - | <code lua>-- Kain give code | ||
| - | local ricevnum=7326 | ||
| - | |||
| - | -- Does he want it? | ||
| - | if not(obj1.vnum==ricevnum) then | ||
| - | say("I don't want this." | ||
| - | </ | ||
lua/scripting/examples/qtimerluavals.1420064302.txt.gz · Last modified: by vodur
