PtokaX forum

Archive => Archived 5.0 boards => Help with scripts => Topic started by: tortilla on 09 October, 2005, 02:25:32

Title: rpblem with rightclicker
Post by: tortilla on 09 October, 2005, 02:25:32
i have robocop 10.01e and ptokax 0.3.3.21(debug)

i modify righclick to use with robocop and freshhstuff

--code------------------------------------------------
-- RightClicker for RoboCopv10.01d
-- Made by Optimus & TiMeTrAVelleR
-- Optomizado y traducido por Pegamento para Mundo Latino
-- este bot solo se recomienda para op vip y reg

aMenu = "']['Mundo?Latino?']['w?rK"
cMenu = "Utilidades"
eMenu = "Logs"
gMenu = "Seguridad del Hub"
sMenu = "']['Mundo?Latino?']['w?rK"
iMenu = "NOTHING"
kMenu = "Menu registros"


SendTo = { --> 1=on/0=off
[02:09] <[]OP[].Pegamento> !getunreg$ConnectToMe ![VIP].Chirli 83.49.70.72:412


please!! what is the problem?? Great mutor please look this xD

thanks
Title:
Post by: tortilla on 09 October, 2005, 13:05:18
hello mutor, not the right click its only for reg vip op .......

in case to change to profiles change in --->

["rules"]="$UserCommand 1 3 "..aMenu.."\\Normas del hub$<%[mynick]> !rules", change the 3 for the number of profile minim to use,not?.

de user commands are listed with novedator are for fresstuff .

this is the fresshstuff i use


--code------------------------------------------------------
--------------- FreshStuff v.3.5 ---------------------------------------------------------
-- original idea/script by chilla
-- completely rewriten by plop
-- Traducido y optomizado por Pegamento
-- it's incompatible with this version
-- anounces the new releas in mainchat
-- converted to lua5 and added search function by bastya_elvtars
-----------------------------------------------------------------------------------------

-- Name the commands to what U like
-- This command adds stuff, syntax : +add TYPE/CATAGORY THESTUFF2ADD
cmd1 = "+add"

-- This command shows the stuff, syntax : +albums with options new/game/warez/music/movie
cmd2 = "+albums"

-- This command deletes an entry, syntax : +del THESTUFF2DELETE
cmd3 = "+del"

-- This command shows the latest stuff, syntax : +nuevo
cmd4 = "+nuevo"

-- This command reloads the txt file. syntax : +reload
-- (this command is needed if you manualy edit the text file)
cmd5 = "+reload"


-- This is for searching inside releases.

cmd6="+search"

-- Show latest stuff on entry 1=yes, 0=no
ShowOnEntry = 1

-- Max stuff shown on newalbums/entry
MaxNew = 20

-- The file storing the stuff
file = "releases.dat"


-- Name of the bot
Bot = "-Novedator-"

-- you can add catagory's yourself ["trigger_name"]="catagory_name"
Types = {["Peliculas"] = "Peliculas", ["Musica"]="Musica", ["Programas"]="Programas", ["Juegos"]="Juegos"}

--------------------- don't change anything below here
AllStuff = {}
NewestStuff = {}

function Main()
   frmHub:RegBot(Bot)
   ReloadRel()
end

function NewUserConnected(user)
   if ShowOnEntry == 1 then
      user:SendPM(Bot, MsgNew.."|")
   end
end

function OpConnected(user)
   if ShowOnEntry == 1 then
      user:SendPM(Bot, MsgNew.."|")
   end
end


function ChatArrival(user,data)
      data = string.sub(data,1,string.len(data)-1)
      s,e,cmd,type,tune = string.find(data, "%b<>%s+(%S+)%s*(%S*)%s*(.*)")
      if cmd == cmd2 then
         if type == "" then
            user:SendPM(Bot, MsgAll.."|")
         elseif type == "nuevo" then
            user:SendPM(Bot, MsgNew.."|")
         elseif Types[type] then
            ShowRelType(type)
            user:SendPM(Bot, MsgType.."|")
         end
         return 1
      elseif cmd == cmd4 then
         user:SendPM(Bot, MsgNew.."|")
         return 1
      elseif user.bOperator then
         if cmd == cmd3 then
            if type ~= "" then
               DelRel(user, type)
            else
               user:SendData(Bot, "yea right, like i know what i got 2 delete when you don't tell me!|")
            end
            return 1
         elseif cmd == cmd1 then
            if tune ~= "" and Types[type] then
               AddRel(user, tune, type)
            elseif Types[type] == nil then
               user:SendData(Bot, "Necesito que ponga la categoria para insertarlo!|")
            else
               user:SendData(Bot, "yea right, like i know what you got 2 add when you don't tell me!|")
            end
            return 1
         elseif cmd == cmd5 then
            Reload()
            user:SendData(Bot, "Albums Cargados!|")
     elseif cmd==cmd6 then
      if type~="" and tune=="" then
         SearchRel(user,type)
      else
         user:SendData(Bot, "yea right, like i know what you got 2 search when you don't tell me!|")
      end
      
            return 1
         end
      end
   end


function OpenRel()
   AllStuff = nil
   NewestStuff = nil
   AllStuff = {}
   NewestStuff = {}
   Count = 0
   Count2 = 0
   local f=io.open(file,"r")
   if f then
      for line in f:lines() do
          Count = Count +1
          AllStuff[Count]=line
      end
   end
   if Count > MaxNew then
      local temp = Count - MaxNew + 1
      for i=temp, Count do
         Count2 = Count2 + 1
         NewestStuff[Count2]=AllStuff
      end
   else
      for i=1, Count do
         Count2 = Count2 + 1
         NewestStuff[Count2]=AllStuff
      end
   end
end

function ShowRel(table)
   Msg = "\r\n"
   if table == NewestStuff then
      if Count2 == 0 then
         MsgNew = "\r\n\r\n".." --------- Ultimas Novedades ']['Mundo?Latino?']['w?rK -------- \r\n\r\n  No hay Novedades en la lista ']['Mundo?Latino?']['w?rK\r\n\r\n --------- Ultimas Novedades ']['Mundo?Latino?']['w?rK -------- \r\n\r\n"
      else
         for i=1, Count2 do
            s,e,type,who,when,title=string.find(NewestStuff, "(.+)$(.+)$(.+)$(.+)")
            if title then
               Msg = Msg.."  "..when.." -- "..tipe.." -- "..title.." -- "..who.."\r\n"
            else
               Msg = Msg..NewestStuff.."\r\n"
            end
         end
         MsgNew = "\r\n\r\n".." --------- Ultimas "..MaxNew.." Novedades ']['Mundo?Latino?']['w?rK -------- "..Msg.."\r\n --------- Ultimas "..MaxNew.."  Novedades ']['Mundo?Latino?']['w?rK -------- \r\n\r\n"
      end
   else
      if Count == 0 then
         MsgAll = "\r\n\r\r\n".." --------- Todo el material ']['Mundo?Latino?']['w?rK-------- \r\n\r\n  No hay material en la lista ']['Mundo?Latino?']['w?rK\n\r\n --------- Todo el Material ']['Mundo?Latino?']['w?rK -------- \r\n\r\n"
      else
         MsgHelp = "  use "..cmd2.."          for a,b in Types do
            MsgHelp = MsgHelp.."/"..a
         end
         MsgHelp = MsgHelp.."> to see only the selected types"
         for i=1, Count do
            s,e,type,who,when,title=string.find(AllStuff, "(.+)$(.+)$(.+)$(.+)")
            if title then
               Msg = Msg.."  ID: "..i.." -- "..when.." -- "..type.." -- "..title.." -- "..who.."\r\n"
            else
               Msg = Msg..AllStuff.."\r\n"
            end
         end
         MsgAll = "\r\n\r\r\n".." --------- Todo el material ']['Mundo?Latino?']['w?rK -------- "..Msg.."\r\n --------- Todo el material ']['Mundo?Latino?']['w?rK -------- \r\n"..MsgHelp.."\r\n"
      end
   end
end

function ShowRelType(what)
   Msg = "\r\n"
   tmp = 0
   if Count == 0 then
      MsgType = "\r\n\r\n".." --------- Todo de "..Types[what].." -------- \r\n\r\n  No "..string.lower(Types[what]).." yet\r\n\r\n --------- Todo de "..Types[what].." -------- \r\n\r\n"
   else
      for i=1, Count do
         s,e,type,who,when,title=string.find(AllStuff, "(.+)$(.+)$(.+)$(.+)")
         if type == what then
            tmp = tmp + 1
            Msg = Msg.."  "..when.." -- "..who.." -- "..title.."\r\n"
         end
      end
      if tmp == 0 then
         MsgType = "\r\n\r\n".." --------- Todo de "..Types[what].." -------- \r\n\r\n  No "..string.lower(Types[what]).." yet\r\n\r\n --------- Todo de "..Types[what].." -------- \r\n\r\n"
      else
         MsgType= "\r\n\r\n".." --------- Todo de "..Types[what].." -------- \r\n"..Msg.."\r\n --------- Todo de "..Types[what].." -------- \r\n\r\n"
      end
   end
end

function AddRel(user, what, type)
   Count = Count + 1
   AllStuff[Count]=(type.."$"..user.sName.."$"..os.date("%x").."$"..what)
   user:SendData(Bot, what.." Ha sido a?adido a las novedades "..type.."|")
   SendToAll(Bot, user.sName.." a?adido a "..type.." releases: "..what.."|")
   SaveRel()
   ReloadRel()
end

function DelRel(user, what)
   if tonumber(what) then
      what = tonumber(what)
      if AllStuff[what] then
         local s,e,which=string.find(AllStuff[what], "([^%$]+)$")
         user:SendData(Bot, which.." es borrado de la base de datos|")
         AllStuff[what]=nil
         SaveRel()
         ReloadRel()
      else
         user:SendData(Bot, what.." No se encuentra en el listado|")
      end
   else
      user:SendData(Bot, "Necesito el numero ID para borrar la entrada|")
   end
end

function SaveRel()
   local f= io.open(file,"w+")
   for i=1,Count do
      if AllStuff then
         f:write(AllStuff.."\n")
      end
   end
   f:flush()
   f:close(f)
end

function ReloadRel()
   OpenRel()
   ShowRel(NewestStuff)
   ShowRel(AllStuff)
end

function DelRelOld(user, what)
   Okie = nil
   for a,b in AllStuff do
      s,e,title=string.find(b, ".+$(.+)$")
      if title == what then
         AllStuff[a]=nil
         user:SendData(Bot, what.." es borrado de la base de datos|")
         Okie = 1
         break
      end
   end
   if Okie then
      SaveRel()
      ReloadRel()
   else
      user:SendData(Bot, what.." no se encuentra en la base de datos|")
   end
end

function SearchRel(user,what)
   local res=0
   local rest={}
   local _,_,bdc=string.find(what,"([%%%[%]%(%)%*%+%-%?%^])")
   local msg=""
   if bdc then
      user:SendData(Bot,"No use el caracter "..bdc)
      return
   end
   for a,b in AllStuff do
      if string.find(b,what) then
         table.insert(rest,b)
      end
   end
   if table.getn(rest)~=0 then
      for a=1,table.getn(rest) do
         s,e,type,who,when,title=string.find(rest[a], "(.+)$(.+)$(.+)$(.+)")
         res = res + 1
         msg = msg.."\r\n  "..when.." -- "..who.." -- "..title
      end
      user:SendPM(Bot,msg.."\r\n\r\n"..res.." resultados.")
   else
      user:SendData(Bot,"Search string "..what.." no se encuentra en la base de datos.")
   end
end--------------------------------------------------------------------------------

look please
Title:
Post by: 6Marilyn6Manson6 on 09 October, 2005, 13:13:16
Usa [ CODE] and [ /CODE] without space.... first and after script please. C ya
Title:
Post by: bastya_elvtars on 09 October, 2005, 14:13:27
The latest FreshStuff has rightclick menu by default.
Title:
Post by: tortilla on 09 October, 2005, 23:12:47
QuoteOriginally posted by bastya_elvtars
The latest FreshStuff has rightclick menu by default.

Please what is the link to this version

thanks
Title:
Post by: bastya_elvtars on 10 October, 2005, 00:42:18
http://ptxscriptdb.psycho-chihuahua.net/download.php?view.82