Still looking for someone to either hel or create the Standalone watchbot.
Functions:
Watchuser - watches for specific user to log into the hub.
Watchfile - Notifies you when the requested file is found in the hub and who has it.
Watchdel - deletes watched items / people
It is not meant to be a spy or anything that would violate a users right to privacy. It is only meant for doing searches when I am away from the computer or when I'm busy doing something else. All watched item are saved in a seperate file named after the user. or something like that.
Hmm.. I am not quiet sure, what you going to do with the search results ?
example a: a pm would be sent notifying the user who wanted the bot to look for a specific user and notify him/her when the user logged in.
example b: the bot would pm the user who defined a search request for the bot to search for letting them know that the file had been found on and and and .
No results would be saved to file or logged. It is just a way to have a bot do my searching for files while I am doing other things on the computer so I dont have to hit the search button every few minutes myself. If needed I will attach the NMDC version of watchbot so everyone gets the right idea. Sorry if this sounds a little harsh, but I wish that people would understand that this request is only to make mine or a users life a little more convenient and not INTENDED to be used for any other alterior-methods or to be used against the user, or to be a "privacy" invasion. I'm not responsible for other stupid people trying to do the wrong thing with the fine abilities of the Ptokax hub software. I would just like this so when I'm working on my website and either a friend comes into my hub or a specific movie or program is found in my hub that the bot will pm me since my dc++ makes the annoying sound when it receives a pm message, so I dont have to be constantly switching from my website just to look at the userlist or submit a search.
Here's the code from the old NMDC script:
'=====================================
' Direct Connect Hub UFWatcher script
'-------------------------------------
' version: 1.0 (010706)
' author: [FF]yopo
' email: yopo@hotmail.com
'=====================================
' This script is online on the hub,
' and will accept requests from users
' that want to know when a specified
' nick or file comes online. When it
' finds a match, it sends a private
' message to the user. Commands are:
'
' watchuser
' watchfile
' watchreset
'
'=====================================
Dim sBotName
Dim lInterval, lCountDown
Dim oFW, oUW
Dim sConfirmMsg
Dim sFileMsg, sUserMsg, sAddUserMsg, sAddFileMsg
Dim sResetMsg, sUserOnline, sWelcomeMsg
Sub Main()
Set oFW = CreateObject("Scripting.Dictionary")
Set oUW = CreateObject("Scripting.Dictionary")
'Set these basic parameters.
sBotName = "WatchBot" ' <- name of the bot
lInterval = 6 ' <- how often to search for files (* 10 seconds)
'The messages sent at different actions.
sFileMsg = "$usr has files matching '$file'."
sUserMsg = "$name logged on."
sAddUserMsg = "Waiting for $name to log on..."
sAddFileMsg = "Started searching for '$file'..."
sResetMsg = "Your watch list was cleared."
sUserOnline = "That user is already online!"
sWelcomeMsg = "Hi there! I will watch for users or files which are " & _
"not here, and then tell you when they come online. Here are the " & _
"commands:" & vcBRLF & vbCRLF & _
" watchuser " & vbTab & "- adds a user to my list" & vbCRLF & _
" watchfile " & vbTab & "- adds a file to my list" & vbCRLF & _
" watchreset" & vbTab & vbTab & "- clears the list" & vbCRLF
frmHub.RegisterBotName(CStr(sBotName))
lCountDown = lInterval
tmrScriptTimer.Interval = 10000
tmrScriptTimer.Enabled = True
End Sub
Sub TimerMethod()
Dim sFind
For Each sFind In oFW.Keys
colUsers.SendToAll "$Search Hub:" & CStr(sBotName) & " F?F?0?0?" & sFind
frmHub.DoEventsForMe
Next
End Sub
Sub DataArival(curUser, sCurData)
Dim sTheText, lPos
Dim sUsrName
Dim sFind, sTmpMsg
If Left(sCurdata, 1) = "<" Or _
Left(sCurData, 5 + Len(sBotName)) = "$To: " & sBotName Then
lPos = InStr(1, sCurData, ">")
sTheText = Mid(sCurData, lPos + 2)
sUsrName = CStr(curUser.sName)
If Left(sTheText, 9) = "watchuser" Then
sFind = Mid(sTheText, 11)
If Not colUsers.Online(CStr(sFind)) Then
If oUW.Exists(sFind) Then
oUW(sFind) = oUW(sFind) & ":" & sUsrName
Else
oUW(sFind) = sUsrName
End If
curUser.PrivateMessage CStr(sBotName), _
Replace(sAddUserMsg, "$name", sFind)
Else
curUser.PrivateMessage CStr(sBotName), CStr(sUserOnline)
End If
ElseIf Left(sTheText, 9) = "watchfile" Then
sFind = Mid(sTheText, 11)
If oFW.Exists(sFind) Then
oFW(sFind) = oFW(sFind) & ":" & sUsrName
Else
oFW(sFind) = sUsrName
End If
curUser.PrivateMessage CStr(sBotName), _
Replace(sAddFileMsg, "$file", sFind)
frmHub.DoEventsForMe
Call TimerMethod
ElseIf sTheText = "watchreset" Then
For Each sFind In oUW.Keys
oUW(sFind) = Replace(oUW(sFind), ":" & sUsrName, "")
If oUW(sFind) = sUsrName Then oUW.Remove(sFind)
Next
For Each sFind In oFW.Keys
oFW(sFind) = Replace(oFW(sFind), ":" & sUsrName, "")
If oFW(sFind) = sUsrName Then oFW.Remove(sFind)
Next
curUser.PrivateMessage CStr(sBotName), CStr(sResetMsg)
ElseIf sTheText = "watchdump" Then
For Each sFind In oUW.Keys
curUser.PrivateMessage CStr(sBotName), _
sFind & " (" & oUW(sFind) & ")"
frmHub.DoEventsForMe
Next
For Each sFind In oFW.Keys
curUser.PrivateMessage CStr(sBotName), _
sFind & " (" & oFW(sFind) & ")"
frmHub.DoEventsForMe
Next
End If
ElseIf Left(sCurData, 3) = "$SR" Then 'incoming search result
If Right(sCurData, Len(sBotName)) = CStr(sBotName) Then
lPos = InStr(5, sCurData, " ")
sWhatUser = Mid(sCurData, 5, lPos - 5)
For Each sFind In oFW.Keys
If InStr(1, LCase(sCurData), LCase(sFind)) > 0 Then
sTmpMsg = Replace(sFileMsg, "$file", sFind)
sTmpMsg = Replace(sTmpMsg, "$usr", sWhatUser)
Call NotifyUsers(oFW(sFind), sTmpMsg)
Call oFW.Remove(sFind)
End If
Next
End If
End If
End Sub
Sub NewUserConnected(curUser)
Dim sUsrName
sUsrName = CStr(curUser.sName)
If oUW.Exists(sUsrName) Then
Call NotifyUsers(oUW(sUsrName), Replace(sUserMsg, "$name", sUsrName))
Call oUW.Remove(sUsrName)
End If
curUser.PrivateMessage CStr(sBotName), CStr(sWelcomeMsg)
End Sub
Sub OpConnected(curUser)
Call NewUserConnected(curUser)
End Sub
Sub NotifyUsers(sUserList, sMsg)
Dim aNicks, sNick
Dim tmpUser
aNicks = Split(sUserList, ":")
For Each sNick In aNicks
If colUsers.Online(CStr(sNick)) Then
Set tmpUser = colUsers.ItemByName(CStr(sNick))
tmpUser.PrivateMessage CStr(sBotName), CStr(sMsg)
frmHub.DoEventsForMe
End If
Next
End Sub
Sub tmrScriptTimer_Timer()
lCountDown = lCountDown - 1
If lCountDown = 0 Then
Call TimerMethod
lCountDown = lInterval
End If
End Sub
Downsides to this script is that it only used the memory to store the requests. Was hoping to get the requests stored to files. Also the ability to delete a certian request instead of just a command to delete all requests.
I know I'm not entitled to anything, I just don't wanna let this thread go undone.
Hmmm.. I get wat u mean.. I saw a script like this somewhere in old forum.. If i come across it, will let you know :)
i had this one in my archive it is just recently made but has some errors i cant seem to find furthermore it is just a requestboard and not a request-search bot but i think it will help you get started.
------------------------------------------------------------------------
--//Request Board Bot
--//(Mr420)
--//A Simple Request Board For The Hub
--//Version 3.0
botname = "Request_Board"
bot_email = ""
bot_speed = ""SoL"-- "Speed of Light" :)"
bot_descr = "Type !help In PM To Me."
bot_share_size = 420.01 * 1024 *1024
my_info_string = "$MyINFO $ALL "..botname.." "..bot_descr.."$" "$"..bot_speed..strchar( 1 ).."$"..bot_email
TimeSpanInMinutes = 600 --//You May Change This
function Main()
frmHub:RegBot(botname)
my_info_string = "$MyINFO $ALL "..botname.." "..bot_descr.."$""$"..bot_speed..strchar( 1 ).."$"..bot_email..
"$"..bot_share_size.."$"
SetTimer(TimeSpanInMinutes*33000)
StartTimer()
end
function NewUserConnected(curUser)
curUser:SendData( my_info_string )
end
function OpConnected(curUser)
curUser:SendData( my_info_string )
end
function OnTimer()
--//Note that a "|" denotes a break in the line
SendToAll("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")
SendToAll(" HI THERE!!!!, I'm The Request_Board.")
SendToAll(" Do You Need A Specific File???")
SendToAll(" REQUEST IT!!!")
SendToAll("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")
SendToAll(" To Request A File, Simply Send !help As A Private Message")
SendToAll(" To Request_Board. Please Be As Specific As You Can.")
SendToAll(" Remember To Check Back To See If Someone Has Obtained Your File.")
SendToAll("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")
end
function tokenize (inString,token)
_WORDS = {}
local matcher = "([^?"..token.."]+)"
gsub(inString, matcher, function (w) tinsert(_WORDS,w) end)
return _WORDS
end
function GetArgs(data)
s,e,whoTo,from,cmd,arg,arg2 = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)%s+(.*)")
return arg,arg2
end
function DataArrival(user, data)
if(strsub(data, 1, 4) == "$To:") then
data=strsub(data,1,strlen(data)-1)
s,e,whoTo = strfind(data,"$To:%s+(%S+)")
if (whoTo == botname) then
s,e,whoTo,from,cmd = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)")
if (cmd=="!help") then
user:SendPM(botname,"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")
user:SendPM(botname," This is the Request_Board!")
user:SendPM(botname,"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")
user:SendPM(botname," Type !help To View This Help Menu.")
user:SendPM(botname," Type !request To Request A File.")
user:SendPM(botname," Type !view To View The Posted Requests/Updates.")
user:SendPM(botname,"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")
user:SendPM(botname," Please Be As Specific As You Can.")
user:SendPM(botname,"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")
end
if (cmd=="!request") then
SendToAll("***New Request Added***")
arg= GetArgs(data)
local handle=openfile("request.dat","a")
write(handle,"("..user.sName..") requested :"..arg.."?")
user:SendPM(botname,"Request entry saved ....")
closefile(handle)
end
if (cmd=="!view") then
handle2=openfile("request.dat","r")
if (handle2==nil) then
else
line = read(handle2,"*a")
line=strsub(line,1,strlen(line)-1)
linearray=tokenize(line,"?")
for i=1,linearray.n do
user:SendPM(botname,linearray)
end
closefile(handle2)
end
end
end
end
end?>
----------------------------------------------------------------------
Quoteend?>
???this is an error...i think
I was able to get the errors out and ge tthe script working. even added the date and time a request was made by a user.
--//Request Board Bot
--//(Mr420)
--//A Simple Request Board For The Hub
--//Version 3.0
botname = "Request_Board"
bot_email = ""
bot_speed = "SoL"-- "Speed of Light" :)"
bot_descr = "Type !help In PM To Me."
bot_share_size = 420.01 * 1024 *1024
my_info_string = "$MyINFO $ALL "..botname.." "..bot_descr.."$".. "$"..bot_speed..strchar( 1 ).."$"..bot_email
TimeSpanInMinutes = 600 --//You May Change This
function Main()
frmHub:RegBot(botname)
my_info_string = "$MyINFO $ALL "..botname.." "..bot_descr.."$".."$"..bot_speed..strchar( 1 ).."$"..bot_email..
"$"..bot_share_size.."$"
SetTimer(TimeSpanInMinutes*33000)
StartTimer()
end
function NewUserConnected(curUser)
curUser:SendData( my_info_string )
end
function OpConnected(curUser)
curUser:SendData( my_info_string )
end
function OnTimer()
--//Note that a "|" denotes a break in the line
SendToAll("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")
SendToAll(" HI THERE!!!!, I'm The Request_Board.")
SendToAll(" Do You Need A Specific File???")
SendToAll(" REQUEST IT!!!")
SendToAll("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")
SendToAll(" To Request A File, Simply Send !help As A Private Message")
SendToAll(" To Request_Board. Please Be As Specific As You Can.")
SendToAll(" Remember To Check Back To See If Someone Has Obtained Your File.")
SendToAll("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")
end
function tokenize (inString,token)
_WORDS = {}
local matcher = "([^?"..token.."]+)"
gsub(inString, matcher, function (w) tinsert(_WORDS,w) end)
return _WORDS
end
function GetArgs(data)
s,e,whoTo,from,cmd,arg,arg2 = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)%s+(.*)")
return arg,arg2
end
function DataArrival(user, data)
if(strsub(data, 1, 4) == "$To:") then
data=strsub(data,1,strlen(data)-1)
s,e,whoTo = strfind(data,"$To:%s+(%S+)")
if (whoTo == botname) then
s,e,whoTo,from,cmd = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(%S+)")
if (cmd=="!help") then
user:SendPM(botname,"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")
user:SendPM(botname," This is the Request_Board!")
user:SendPM(botname,"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")
user:SendPM(botname," Type !help To View This Help Menu.")
user:SendPM(botname," Type !request To Request A File.")
user:SendPM(botname," Type !view To View The Posted Requests/Updates.")
user:SendPM(botname,"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")
user:SendPM(botname," Please Be As Specific As You Can.")
user:SendPM(botname,"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")
end
if (cmd=="!request") then
SendToAll("***New Request Added***")
arg= GetArgs(data)
local handle=openfile("request.dat","a")
write(handle,"On "..date("%m/%d/%y").." at "..date("%H:%M").." "..user.sName.." requested: "..arg.."?")
user:SendPM(botname,"Request entry saved ....")
closefile(handle)
end
end
if (cmd=="!view") then
handle2=openfile("request.dat","r")
if (handle2==nil) then
else
line = read(handle2,"*a")
line=strsub(line,1,strlen(line)-1)
linearray=tokenize(line,"?")
for i=1,linearray.n do
user:SendPM(botname,linearray)
end
closefile(handle2)
end
end
end
end
however it still isnt quite what I was looking for. but this thread will continue on.