New Forum Functionality

Post Reply
User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

New Forum Functionality

Post by demonnic »

Ok, I have installed a geshi based syntax highligher on the forum. There are a couple of ways to use it:

you can use the language as a bbcode tag. IE ["lua"] code here ["/lua"] minus the "" in the bbcode tags. There are over 100 programming and scripting languages supported this way.

you can also use ["syntax"] and ["/syntax"] .. details can be found here: info on syntax highlighter


oh, and it looks like this (code taken from Iocun's speedwalker thread.)

Code: [show] | [select all] lua
    walklist = {}
    walkdelay = 0

    function speedwalktimer()
       send(walklist[1])
       table.remove(walklist, 1)
       if #walklist>0 then
          tempTimer(walkdelay, [[speedwalktimer()]])
       end
    end


    function speedwalk(dirString, backwards, delay)
       local dirString   =   dirString:lower()
       walklist         =   {}
       walkdelay         =   delay
       local reversedir   =   {
                         n   = "s",
                         en   = "sw",
                         e   = "w",
                         es   = "nw",
                         s   = "n",
                         ws   = "ne",
                         w   = "e",
                         wn   = "se",
                         u   = "d",
                         d   = "u",
                         ni   = "out",
                         tuo = "in"
                         }

       if not backwards then
          for count, direction in string.gmatch(dirString, "([0-9]*)([neswudio][ewnu]?t?)") do     
               count = (count == "" and 1 or count)
             for i=1, count do
                if delay then walklist[#walklist+1] = direction
                else send(direction)
                end
             end
          end
       else
          for direction, count in string.gmatch(dirString:reverse(), "(t?[ewnu]?[neswudio])([0-9]*)") do     
               count = (count == "" and 1 or count)
             for i=1, count do
                if delay then walklist[#walklist+1] = reversedir[direction]
                else send(reversedir[direction])
                end
             end
          end
       end

    if walkdelay then speedwalktimer() end

    end

the above made using the lua form, but added filename="iocun-speedwalking.lua" inside the opening tag.

Post Reply