PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: kartman on 13 February, 2005, 03:26:00

Title: ==have news in right clic==
Post by: kartman on 13 February, 2005, 03:26:00
hello!!
I search a script who will permit me to display a racourci to manage
the news directly to the right click if somebody can help me thank you
beforehand . 8)
Title:
Post by: b_w_johan on 13 February, 2005, 13:00:21
Quote-- thx to rightclicker from robocop and some others
-- Edited by b_w_Johan

Bot = "robotje"

SendTo = {
  • = 1,   -- Masters
  • [1] = 1,   -- Operators
    [2] = 1,   -- Vips
    [3] = 0,   -- Regs
    [4] = 1,   -- Moderator
    [5] = 1,   -- NetFounder
    [-1] = 0,  -- Users
    }

    function Main()
       frmHub:RegBot(Bot)
    end


    function DataArrival(curUser,data)

       if CheckTrig[strsub(data,1,4)] then
          MyInfos[curUser.sName] = MyInfos[curUser.sName] or 1
          MyInfos[curUser.sName] = MyInfos[curUser.sName] + 1
          if MyInfos[curUser.sName] >= 4 then
             MyInfos[curUser.sName] = nil
             curUser:Disconnect()
          end
       end
    end


    function DataArrival(user,data)
                  data = strsub(data, strfind(data, "> !") + 2, strlen(data) - 1)
               if (strsub(data, 1, 8) == "!install") then
          if (SendTo[user.iProfile]==1) then
                        customCMDs(user)
                   end
                  end
    end


    function OpConnected(user)
       if (SendTo[user.iProfile]==1) then
                    user:SendData("$UserCommand 1 3 Install$<%[mynick]> !install %[nick]||")
       end
    end


    function NewUserConnected(user)
       if (SendTo[user.iProfile]==1) then
          user:SendData("$UserCommand 0 3 |")
          user:SendData("$UserCommand 1 3 Install OP commands$<%[mynick]> !install %[nick]||")
       end
    end


    function GetRightClick(user, table1, table2)
       for cmd,_ in table1 do
          if table1[cmd][user.iProfile] == 1 then
             for value,command in table2 do
                if cmd == value then
                   user:SendData(command)
                end
             end
          end
       end
    end



    function customCMDs(user)
       user:SendData("$UserCommand 1 3 bot\\text$<%[mynick]>set text here||")                  -- tekst


       user:SendData("$UserCommand 1 3 bot\\OP Commands\\Warn User$<%[mynick]> !warn %[nick] %[line:Reason]||")      -- warn
       user:SendData("$UserCommand 1 3 bot\\OP Commands\\Ban User$<%[mynick]> !ban %[nick] %[line:Reason]||")      -- Ban
       user:SendData("$UserCommand 1 3 bot\\OP Commands\\Get Banlist$<%[mynick]>  !getbanlist||")         -- Banlijst
       user:SendData("$UserCommand 1 3 bot\\OP Commands\\Unban User$<%[mynick]> !unban %[line:nick]||")         -- Unban
       user:SendData("$UserCommand 1 3 bot\\OP Commands\\Restart Scripts$<%[mynick]> !restartscripts|")         -- restartscripts


    end

not shure this is what you wanted but it shows the OPcommands to all but onlyy usable by OPs+
and the text commands can be used by everyone ...


   user:SendData("$UserCommand 1 3 bot\\text$<%[mynick]>set text here||")                  -- tekst

paste some extra of this for info yust shown in main extra function is this is not visible !

yust type !install or use the rightmouse install to see all !
Title:
Post by: b_w_johan on 13 February, 2005, 13:01:27
btw did not test it copy't from my bot so if it doesn't work ill check it but if im correct this is all you need..

greetings Johan