PtokaX forum

Archive => HOW-TO's => Archived 5.1 boards => Old HOW-TO's => Topic started by: yoonohoo on 27 June, 2005, 12:32:04

Title: Client cmd rc
Post by: yoonohoo on 27 June, 2005, 12:32:04
I want to make a rightclick for the cmd /imdb.
I used this syntax (I can hear some of you laughing):
curUser:SendData("$UserCommand 1 3 IMDB$<%[mynick]>  /imdb %[line:Filme a pesquisar]|") Where did I go wrong?...Probably the whole lot!

Also which are the profiles covered by the function NewUserConnected(curUser) and function OpConnected(curUser). My profiles are unreg, reg, vip, op, master and netfounder.

Thanks
Title:
Post by: ConejoDelMal on 27 June, 2005, 12:47:42
well...you just forgot the "|" in the end...

curUser:SendData("$UserCommand 1 3 IMDB$<%[mynick]> /imdb %[line:Filme a pesquisar]||")

NewUserConnected covers all non key users, OpConnected, all the key users. If you want this command for a specific profile --> If user.iProfile == x or user.iProfile == x2 then

being x and x2 the profile numbers you wish
Title:
Post by: yoonohoo on 27 June, 2005, 13:39:40
Didn't work! I think you have to use client command instead user command...Does it make sense?
Title:
Post by: ConejoDelMal on 27 June, 2005, 13:56:43
Not really... the structure is always the same, it doesnt depends on what kind of command it is.. i think the problem might be in the rest of the script... if you post it it will be easier to help you
Title:
Post by: yoonohoo on 27 June, 2005, 14:24:21
Here it is...

-- PtokaX Lua 5 version by PPK
             
-- UserCommand extension script for PtokaX by Gadget


function NewUserConnected(curUser)

       if curUser.bUserCommand then

               curUser:SendData("$UserCommand 255 7")

               curUser:SendData("$UserCommand 0 3")

               curUser:SendData("$UserCommand 1 3 Ajuda\\Comandos$<%[mynick]> !help|")

               curUser:SendData("$UserCommand 1 3 Ajuda\\Regras$<%[mynick]> +regras|")

              curUser:SendData("$UserCommand 1 3 Ajuda\\Info$<%[mynick]> +info|")

               curUser:SendData("$UserCommand 1 3 Ajuda\\Rede$<%[mynick]> +rede|")

               curUser:SendData("$UserCommand 1 3 IMDB$<%[mynick]>  /imdb %[line:Filme a pesquisar]||")
       
       end

end




function OpConnected(curUser)

       if curUser.bUserCommand then

               curUser:SendData("$UserCommand 255 7")

               curUser:SendData("$UserCommand 0 3")

               curUser:SendData("$UserCommand 1 3 IMDB$<%[mynick]>  /imdb %[line:Filme a pesquisar]||")

               curUser:SendData("$UserCommand 1 3 Regras$<%[mynick]> +regras|")

               curUser:SendData("$UserCommand 1 3 Ajuda$<%[mynick]> !help|")

               curUser:SendData("$UserCommand 1 3 Mass Message$<%[mynick]> !massmsg %[line:message to all users]|")

               curUser:SendData("$UserCommand 1 2 Inbuild\\ Show user info$<%[mynick]> !getinfo %[nick]|")

               curUser:SendData("$UserCommand 1 2 Inbuild\\ Drop user$<%[mynick]> !drop %[nick]|")

               curUser:SendData("$UserCommand 1 2 Inbuild\\ Gag Menu\\Gag user$<%[mynick]> !gag %[line:nick]|")

               curUser:SendData("$UserCommand 1 2 Inbuild\\ Gag Menu\\Ungag user$<%[mynick]> !ungag %[line:nick]|")

               curUser:SendData("$UserCommand 1 3 Inbuild\\ Ban Menu\\Ban and kick user$<%[mynick]> !ban %[line:nick] %[line:Enter a reason]|")

               curUser:SendData("$UserCommand 1 3 Inbuild\\ Ban Menu\\Ban user$<%[mynick]> !nickban %[line:nick]|")

               curUser:SendData("$UserCommand 1 3 Inbuild\\ Ban Menu\\Ban IP...$<%[mynick]> !banip %[line:Enter an IP to ban]|")

               curUser:SendData("$UserCommand 1 3 Inbuild\\ Ban Menu\\Unban user or ip...$<%[mynick]> !unban %[line:Enter an IP or name to unban]|")

               curUser:SendData("$UserCommand 1 3 Inbuild\\ Ban Menu\\Temp Ban and kick user$<%[mynick]> !tempban %[line:nick] %[line:Enter a time] %[line:Enter a reason]|")

               curUser:SendData("$UserCommand 1 3 Inbuild\\ Ban Menu\\Temp Unban ip...$<%[mynick]> !tempunban %[line:Enter an IP to unban]|")

               curUser:SendData("$UserCommand 1 3 Inbuild\\ Ban Menu\\Clear all temp bans$<%[mynick]> !clrtempban|")

               curUser:SendData("$UserCommand 1 1 Inbuild\\ Ban Menu\\Show ban list$<%[mynick]> !getbanlist|")

               
       end

end
Title:
Post by: Dessamator on 27 June, 2005, 14:34:17
cant be done, thats a raw command, only dc developers can add that
Title:
Post by: ConejoDelMal on 27 June, 2005, 19:31:11
I guess it can be done.... but just people who have a client that supports it like Bcdc will benefit from it, the rest will just send a message to main :P

*edited*
and i thought he is aware of this
Title:
Post by: ConejoDelMal on 27 June, 2005, 19:35:54
-- PtokaX Lua 5 version by PPK
-- UserCommand extension script for PtokaX by Gadget

function NewUserConnected(curUser)

    if curUser.bUserCommand then
               curUser:SendData("$UserCommand 255 7")
               curUser:SendData("$UserCommand 0 3")
               curUser:SendData("$UserCommand 1 3 Ajuda\\Comandos$<%[mynick]> !help|")
               curUser:SendData("$UserCommand 1 3 Ajuda\\Regras$<%[mynick]> +regras|")
              curUser:SendData("$UserCommand 1 3 Ajuda\\Info$<%[mynick]> +info|")
               curUser:SendData("$UserCommand 1 3 Ajuda\\Rede$<%[mynick]> +rede|")
               curUser:SendData("$UserCommand 1 3 IMDB$<%[mynick]> /imdb %[line:Filme a pesquisar]||")
       end
end


function OpConnected(curUser)

       if curUser.bUserCommand then
               curUser:SendData("$UserCommand 255 7")
               curUser:SendData("$UserCommand 0 3")
               curUser:SendData("$UserCommand 1 3 IMDB$<%[mynick]> /imdb %[line:Filme a pesquisar]||")
               curUser:SendData("$UserCommand 1 3 Regras$<%[mynick]> +regras|")
               curUser:SendData("$UserCommand 1 3 Ajuda$<%[mynick]> !help|")
               curUser:SendData("$UserCommand 1 3 Mass Message$<%[mynick]> !massmsg %[line:message to all users]|")
               curUser:SendData("$UserCommand 1 2 Inbuild\\ Show user info$<%[mynick]> !getinfo %[nick]|")
               curUser:SendData("$UserCommand 1 2 Inbuild\\ Drop user$<%[mynick]> !drop %[nick]|")
               curUser:SendData("$UserCommand 1 2 Inbuild\\ Gag Menu\\Gag user$<%[mynick]> !gag %[line:nick]|")
               curUser:SendData("$UserCommand 1 2 Inbuild\\ Gag Menu\\Ungag user$<%[mynick]> !ungag %[line:nick]|")
               curUser:SendData("$UserCommand 1 3 Inbuild\\ Ban Menu\\Ban and kick user$<%[mynick]> !ban %[line:nick] %[line:Enter a reason]|")
               curUser:SendData("$UserCommand 1 3 Inbuild\\ Ban Menu\\Ban user$<%[mynick]> !nickban %[line:nick]|")
               curUser:SendData("$UserCommand 1 3 Inbuild\\ Ban Menu\\Ban IP...$<%[mynick]> !banip %[line:Enter an IP to ban]|")
               curUser:SendData("$UserCommand 1 3 Inbuild\\ Ban Menu\\Unban user or ip...$<%[mynick]> !unban %[line:Enter an IP or name to unban]|")
               curUser:SendData("$UserCommand 1 3 Inbuild\\ Ban Menu\\Temp Ban and kick user$<%[mynick]> !tempban %[line:nick] %[line:Enter a time] %[line:Enter a reason]|")
               curUser:SendData("$UserCommand 1 3 Inbuild\\ Ban Menu\\Temp Unban ip...$<%[mynick]> !tempunban %[line:Enter an IP to unban]|")
               curUser:SendData("$UserCommand 1 3 Inbuild\\ Ban Menu\\Clear all temp bans$<%[mynick]> !clrtempban|")
               curUser:SendData("$UserCommand 1 1 Inbuild\\ Ban Menu\\Show ban list$<%[mynick]> !getbanlist|")
       end
end

you just had a space too much between <%[mynick]> and the command  ;)
Title:
Post by: PPK on 27 June, 2005, 20:52:03
QuoteOriginally posted by yoonohoo
I want to make a rightclick for the cmd /imdb.
If you want it as usercommand then you need script on hub supporting this /imdb command. If you want to use internal client /imdb command then is not posible with usercommand :(
QuoteOriginally posted by [AT]conejodelmal
well...you just forgot the "|" in the end...
And you need to read scripting interface docs :P
QuoteSendData(Data)            - Data without ending | !
Title:
Post by: ConejoDelMal on 27 June, 2005, 21:17:11
:blushes:

upsss, sorry about all the sh** i said then... lol

my intentions were good..
Title:
Post by: yoonohoo on 27 June, 2005, 21:29:53
Thanks anyway to all