Let me see if I understtod you are saying that you have the comands of DC++ and you manualy add to your right click comands ???
If yes, well i think that will not work, but you can see here...
http://dcplusplus.sourceforge.net/forum/index.php
Best regards, nErBoS
This question really belongs to the developers of the client, I'm assuming it's DC++.
When you execute a User Command the Client can only do one thing, Send RAW Data to a connected Hub. That RAW data can be formatted so that it appears in Main Chat or in a PM to a specified User/Bot. There is also an option to specify that it should only be sent once for a given nick. For instance, if you selected several items in a search panel and used a KICK-BAN command you'd only want to send it once for each user.
N.B. There is no option to send data to DC++ itself as of v.306
The commands you are trying to do are Client commands and the Client handles those commands when they are type into Main Chat or a PM window before it decides whether or not to send the typed text to the hub. That's why you can refresh your filelist without everyone on the hub seeing "/refresh" every time.
So in short, you cannot do what you are trying to do.
For more info about UserCommand structure/syntax etc go here: DC++ Wiki - UserCommand (http://dcplusplus.sourceforge.net/wiki/index.php/UserCommand%20command)
*Edit*
Damn Sedulus you posted while I was writing.... and you quoted Source Code too... what a smartass! :P :D :P
*/Edit*
Hi,
Sorry for the last post, I hadn't checked correctly. I found this IMDB script, but for some reason, I can't get it to work. I notice one thing, it's the mention of Mozilla/4.0 somewhere around the middle. Should I conclude that this command will only work for Mozilla users and not for IExplorer or Opera? Here's the script:
--imdb.freedb.http-V.1.lua by chilla
--------------------------------------------------------------------------------------------------------------------------
bot = "Bach"
ifPrefix = "%!%+%-%?"
cmd1 = "imdb"
cmd2 = "freedb"
ifhelp = "\tPrefixa: ! - + ?\r\n\tSyntax: Prefix\""..cmd1.."\" Movie\r\n\tSyntax: Prefix\""..cmd2.."\" Artist\r\n\tSyntax: Prefix\""..cmd2.."\" Artist Album\r\n"
--------------------------------------------------------------------------------------------------------------------------
-- This shows also an album when search in freedb when set to value 1
showAlbum = 1
--------------------------------------------------------------------------------------------------------------------------
function DataArrival(curUser,data)
if (strsub(data,1,1) == "<") then
data = strsub(data,1,strlen(data)-1)
local _,_,cmd = strfind( data, "%b<>%s["..ifPrefix.."](%S+)" )
if (cmd and strlower(cmd) == strlower(cmd1)) then
local _,_,str1 = strfind(data,"%b<>%s+%S+%s+(.*)")
if str1 then
curUser:SendData(bot,GetImdbEntry(str1))
else
curUser:SendData(bot,ifhelp)
end
return 1
elseif (cmd and strlower(cmd) == strlower(cmd2)) then
local _,_,str1 = strfind(data,"%b<>%s+%S+%s+(.*)")
if str1 then
local sItem1 = gsub(str1,"%s","%+")
sItem1 = "freedb_search.php?words="..sItem1.."&allfields=NO&fields=artist&allcats=YES&grouping=none"
curUser:SendData(bot,GetFreeDBEntry(str1,sItem1))
else
curUser:SendData(bot,ifhelp)
end
return 1
end
end
end
--------------------------------------------------------------------------------------------------------------------------
-- **FUNCS**
--------------------------------------------------------------------------------------------------------------------------
function GetFreeDBEntry(str1,shttp,ret)
local set,httpn,sAlbum,host = 0,"","","www.freedb.org"
GETHTML = "GET /"..shttp.." HTTP/1.1\r\nHost: "..host.."\r\nUser-Agent: Mozilla/4.0 (compatible; LUA 4.0; LUA 4.0)\r\n"
socket, e = connect(host, 80)
local msg = ""
local msg2 = ""
if not e then
local line = ""
socket:timeout(2)
socket:send(GETHTML..strchar(13,10))
local handle = openfile("test2.html","w")
while not e do
line1, e = socket:receive("*l")
write(handle,line1.."\r\n")
if strfind(line1,"
(.*)
") then
_,_,sAlbum = strfind(line1,"
(.*)
")
end
if line1 == "
" do
line1, e = socket:receive("*l")
write(handle,line1.."\r\n")
if strfind(line1, "
(.*)
|
") then
local _,_, httpt,sname = strfind(line1, "
(.*)
|
")
if set == 0 then
httpn = httpt
set = 1
end
msg = msg.."\tAlbum: "..sname.." Site: http://www.freedb.org/"..httpt.."\r\n"
end
if strfind(line1,"
(.*)%. | %s(%S+) | (.*)") then local _,_,track,length,title = strfind(line1," |
(.*)%. | %s(%S+) | (.*)") msg2 = msg2.."\t"..track..". "..title.." ( "..length.." )\r\n" end end end end closefile(handle) socket:close() end print(e,i) if set == 1 and showAlbum == 1 then msg = msg.."\r\n\r\n"..GetFreeDBEntry("X",httpn,1) end if msg ~="" then msg = "\tSearchItem : "..str1.."\r\n\r\n"..msg end if msg2 ~= "" then msg2 = "\tAlbum: "..sAlbum.."\r\n\r\n"..msg2 end if ret == 1 then return msg2 else return msg end end -------------------------------------------------------------------------------------------------------------------------- function GetImdbEntry(sItem)
GETHTML = "GET /Tsearch?title="..sItem.." HTTP/1.1\r\nHost: //www.imdb.com\r\nUser-Agent: Mozilla/4.0 (compatible; LUA 4.0; LUA 4.0)\r\n"
socket, e = connect("www.imdb.com", 80) local msg = "\r\n" if not e then local line = "" socket:timeout(2) socket:send(GETHTML..strchar(13,10)) local handle = openfile("test.html","w") while not e do line1, e = socket:receive("*l") write(handle,line1.."\r\n") if line1 == "" then line1, e = socket:receive("*l") write(handle,line1.."\r\n") while line1 ~= "" do _,_,httpt,mname = strfind(line1,".*=\"(%S+)\">(.*).*") if httpt and mname then msg = msg.."\t"..mname.." Site: http://www.imdb.com"..httpt.."\r\n" end line1, e = socket:receive("*l") write(handle,line1.."\r\n") end end end closefile(handle) socket:close() end return "\tSearched Movie: "..sItem.."\r\n\r\n\tResults:\r\n"..msg
cheers, pieltre
Hi,
Seems nobody is replying on the IMDB script, even the guy who made it, so I'll skip that part for now. I have, instead, another question concerning the Usercommand script. As it is now, all my commands are sent in the main chat and that is a pain. I tried rewriting the code so it would send the command to the appropriate bot, but all it does, when I perform the right click command, is disconnect me.... here's what I have for one of those commands:
curUser:SendData("$UserCommand 1 2 Mass Message$$To: Bot <%[mynick]> +mm %[line:Enter message]|")
what am I doing wrong?
thanks in advance, Pieltre
QuoteOriginally posted by HaArD For more info about UserCommand structure/syntax etc go here: DC++ Wiki - UserCommand (http://dcplusplus.sourceforge.net/wiki/index.php/UserCommand%20command)
Did you visit that link? The answers you seek are already there.........
hi there,
at the same time I'm very interested in this script, and at the same time I don't get it :P
What is it suppose to do? Change the righ click choices of the client? Wouln't you have to change the client for it?
*lovestounderstand* :D
One might wonder...
What is the point of providing a link to the answers if no one bothers to click it and read what's there .... *sigh*
Hi,
I read that link, thanks. It did help, but not entirely. The whole problem about this seems to lie in the fact that what I'm doing here is using script, not a client, that allows to force a standard right click menu on all the users connected to my hub. So, whatever client you use, when my script is on, you automatically have in a right click menu, the list of all the available commands in my hub (at least all those that I entered).
As such, the scripts works fine. It's rather simple to configure, except for the two problems I mentioned earlier. I still haven't found anyways to solve them. But I found a way to elude them. The first is to use an indenpendant script that performs the IMDB command, instead of relying on the DC++ commands (which is an input command and therefore doesn't go through the hub). The second way was to get my commands not to be sent to the bots that perform them, but simply to get them to be performed"silently". For that, I had to rearrange my scripts a lot and finally opted for Robocop. So, to resume the last part. Using Robocop, I now have all my old commands performed without everybody seeing them in the main chat and I also have them listed in a right click menu (since all the robocop commands were easy to enter in my script). I paste here my script (divided in two menus, one for the Reg users and one for the OP/Master).
-- UserCommand extension script for PtokaX by Gadget function NewUserConnected(curUser) curUser:SendData("$UserCommand 255 7") curUser:SendData("$UserCommand 0 3") curUser:SendData("$UserCommand 1 3 *** "..frmHub:GetHubName().." (PtokaX) ***$<%[mynick]> +rules|") curUser:SendData("$UserCommand 1 3 Hub rules$<%[mynick]> !rules|") curUser:SendData("$UserCommand 1 3 Show available commands$<%[mynick]> !userhelp|") curUser:SendData("$UserCommand 1 3 Show DC++ FAQ$<%[mynick]> !faq|") curUser:SendData("$UserCommand 1 3 Show users with free slot$<%[mynick]> !slot|") curUser:SendData("$UserCommand 1 3 What's my IP address?$<%[mynick]> !myip|") curUser:SendData("$UserCommand 1 3 How long was I here?$<%[mynick]> !myhubtime|") curUser:SendData("$UserCommand 1 3 Show Grand Network's Hublist$<%[mynick]> !network|") curUser:SendData("$UserCommand 1 3 Last seen here...$<%[mynick]> !seen %[line:Enter a nickname]#124;") curUser:SendData("$UserCommand 1 3 Away from Keyboard (afk)$<%[mynick]> !away %[line:Enter a reason]|") curUser:SendData("$UserCommand 1 3 Back to keyboard$<%[mynick]> !back %[line:Enter a reason]|") curUser:SendData("$UserCommand 1 3 Report Fakers$<%[mynick]> !report %[line:nickname]|")
end function OpConnected(curUser) curUser:SendData("$UserCommand 255 7") curUser:SendData("$UserCommand 0 3") curUser:SendData("$UserCommand 1 3 *** "..frmHub:GetHubName().." (PtokaX) ***$<%[mynick]> +rules|") curUser:SendData("$UserCommand 1 2 Hub rules$<%[mynick]> !rules|") curUser:SendData("$UserCommand 1 2 Hub Statistics$<%[mynick]> !hstat|") curUser:SendData("$UserCommand 1 2 Show Grand Network's Hublist$<%[mynick]> !network|") curUser:SendData("$UserCommand 1 2 Available Commands$<%[mynick]> !help|") curUser:SendData("$UserCommand 1 2 Slot$<%[mynick]> !slot|") curUser:SendData("$UserCommand 1 2 Away From Keyboard$<%[mynick]> !away %[line:Enter a reason]|") curUser:SendData("$UserCommand 1 2 Back to Keyboard$<%[mynick]> !back %[line:Enter a reason]|") curUser:SendData("$UserCommand 1 2 Mass Message$<%[mynick]> !mass %[line:Enter message]|") curUser:SendData("$UserCommand 1 2 Register User$<%[mynick]> !reg %[line: enter a nickname] %[line:Enter a password]|") curUser:SendData("$UserCommand 1 2 Upgrade a User's status$<%[mynick]> !upgrade %[nick] %[line:reg/vip/op/master]|") curUser:SendData("$UserCommand 1 2 Show user Info$<%[mynick]> !info %[nick]|") curUser:SendData("$UserCommand 1 2 Show user History$<%[mynick]> !userinfo %[nick]|") curUser:SendData("$UserCommand 1 2 Show Registered Users$<%[mynick]> !showreg|") curUser:SendData("$UserCommand 1 2 Search IP$<%[mynick]> !ipinfo %[line:Enter an IP to search]|") curUser:SendData("$UserCommand 1 2 Search IP Range$<%[mynick]> !iprangeinfo %[line:Enter an IP range to search]|") curUser:SendData("$UserCommand 1 2 Show ban List$<%[mynick]> !getbanlist|") curUser:SendData("$UserCommand 1 2 Gag User$<%[mynick]> !gag %[nick]|") curUser:SendData("$UserCommand 1 2 Ungag User$<%[mynick]> !ungag %[nick]|") curUser:SendData("$UserCommand 1 2 Drop User$<%[mynick]> !drop %[nick]|") curUser:SendData("$UserCommand 1 2 Warn User (3 warnings=ban)$<%[mynick]> !warn %[nick]|") curUser:SendData("$UserCommand 1 2 Watch this User...$<%[mynick]> !watch %[line:Enter nickname]|") curUser:SendData("$UserCommand 1 2 Stop Watching!$<%[mynick]> !watchoff|") curUser:SendData("$UserCommand 1 2 Ban and Kick User$<%[mynick]> !kill %[nick] %[line:Enter a reason]|") curUser:SendData("$UserCommand 1 2 Ban IP...$<%[mynick]> !banip %[line:Enter an IP to ban]|") curUser:SendData("$UserCommand 1 2 Unregister User$<%[mynick]> !delreguser %[line:Enter nickname]|") curUser:SendData("$UserCommand 1 2 Flood$<%[mynick]> +flood %[line:Enter a reason]|") curUser:SendData("$UserCommand 1 2 Unban User or IP...$<%[mynick]> !unban %[line:Enter an IP or name to unban]|") curUser:SendData("$UserCommand 1 2 Clear all Temp Bans$<%[mynick]> !clrtempban|") curUser:SendData("$UserCommand 1 2 Clear all Perm Bans$<%[mynick]> !clrpermban|") curUser:SendData("$UserCommand 1 2 Restart Hub$<%[mynick]> !restart|") curUser:SendData("$UserCommand 1 2 Restart Scripts$<%[mynick]> !restartscripts|")
end
Oh, and I forget, the guy who made the IMDB script, just posted an alternative version that does the same with Google...
cheers, Pieltre
QuoteOriginally posted by Pieltre Oh, and I forget, the guy who made the IMDB script, just posted an alternative version that does the same with Google...
cheers, Pieltre
Who, and where? :D And by the way, this script is so awesome I can't believe noone's reacting. It must old news or something ?( Maybe you'd care to explain what the numbers after "$UserCommand" means though (255, 7, 1, 3, ect.). That'd be nice. Thx.
Hi yepyepyep4711,
Check the link that HaArd posted two or three replies above, it explains how the script works. As for the Imdb and the Google search, check this (http://board.univ-angers.fr/thread.php?threadid=691&boardid=12&sid=be5338485f80da3793183e58b1826caa) in 'finished scripts'. If you can get it to work, you can obviously add it to the right click command menu... As for myself, I need to check it again, since so far, it doesn't seem to work...
regards, Pieltre
Cheers Hard for the Link as i too use gadgets user.command script :)
QuoteOriginally posted by Pieltre Hi yepyepyep4711,
Check the link that HaArd posted two or three replies above, it explains how the script works. As for the Imdb and the Google search, check this (http://board.univ-angers.fr/thread.php?threadid=691&boardid=12&sid=be5338485f80da3793183e58b1826caa) in 'finished scripts'. If you can get it to work, you can obviously add it to the right click command menu... As for myself, I need to check it again, since so far, it doesn't seem to work...
regards, Pieltre
Thx alot, I *should* read more. Hope you got it to work, it works for me and it's quite a help. Wooshman showed me you could put the complete raw commands in one text file and post it in one go, also.
|