Having a bot PM you?

Which hub software is the best? Where can I find script XXX? Discuss it here...(no, this is not for advertising your hub...)

Moderator: Moderators

Locked
Josh_J
Posts: 11
Joined: 2003-01-14 22:22
Contact:

Having a bot PM you?

Post by Josh_J » 2003-01-14 22:30

Hello everyone, I'm a beginner to dc hub scripts and I have the generalbot script. I was wondering if it's possible to make the bot pm instead of show in the hub. It get's rather distracting when someone is talking and it floods out what they are saying. Also, would it be possible to have the script pm with the commands when an op enters the hub? Let me know if anyone can help me out.


Thanks,
Josh_J

aDe
Forum Moderator
Posts: 138
Joined: 2003-01-07 09:14
Location: SE
Contact:

Post by aDe » 2003-01-15 03:29

check out the help.script included in the hub. you can send PMs with the .PrivateMessage function of users. To check if a user is a op, use .bOperator property..
This example will send a pm to a op when he/she logs on..

Code: Select all

Sub NewUserConnected (curUser)
 If curUser.bOperator Then 
   curUser.PrivateMessage "from", "message"
 End If
End Sub

Josh_J
Posts: 11
Joined: 2003-01-14 22:22
Contact:

Need some more help..

Post by Josh_J » 2003-01-15 14:19

Hello and thanks for the fast reply. I tried to do as you say but when I do I get an error in dc hub about expected "end sub". Is there a certain place I put this in general bot? Because I'm trying to get it to pm the user commands on operator join and I either get the end sub error or the error about a string error. Is there anything I can do or use to tell me where i'm messing up?


Thanks Again,
Josh_J

aDe
Forum Moderator
Posts: 138
Joined: 2003-01-07 09:14
Location: SE
Contact:

Post by aDe » 2003-01-15 14:24

you must add the example sub outside any other sub. But- i presume there is already a NewUserConnected sub added in the script, so copy the example without the first and the last row, and add it to the very beginning of the NewUserConnected sub in the script

Josh_J
Posts: 11
Joined: 2003-01-14 22:22
Contact:

Help?!?!

Post by Josh_J » 2003-01-15 15:36

Ok, thanks again for the speedy reply..I got it to work in the dc hub program without errors but I don't get a pm when I log on...What exactly do I put in the "from" part? I've tried sBotName but that doesn't seem to work. Any more suggestions?

Thanks, :o
Josh_J

Josh_J
Posts: 11
Joined: 2003-01-14 22:22
Contact:

Ok...

Post by Josh_J » 2003-01-15 16:10

Ok, I got it to work, but the thing is that it won't run. Btw, please ignore my post before...this is what I have so far but I keep getting a syntax error, would you know what I am doing wrong? :?

Code: Select all

Sub NewUserConnected(curUser)
  If curUser.bOperator Then 
   curUser.PrivateMessage "Videl", "Following commands are available:" & vbCRLF & _
"ban <ip/name> [reason]" & vbTab & "bans permanently a user" & vbCRLF & _
"ipban <ip or name>" & vbTab & "bans permanently users ip" & vbCRLF & _
"unban <ip or name>" & vbTab & "removes bans from user or ip" & vbCRLF & _
"disconnect <name> [reason]" & vbTab & "disconnects a user" & vbCRLF & _
"redirect <name> [address]" & vbTab & "redirects a user" & vbCRLF & _
"kick <name> [reason]" & vbTab & "kicks a user" & vbCRLF & _
"kickban <name> [reason]" & vbTab & "kicks and bans permanently a user" & vbCRLF & _
"flood <name> [flood text]" & vbTab & "floods a user" & vbCRLF & _
"cleartemp" & vbTab & "clears the temporary ban list" & vbCRLF & _
"userinfo [name]" & vbTab & "displays user info" & vbCRLF & _
"reset <name>" & vbTab & "resets users kick counter" & vbCRLF & _
"ipinfo <ip>" & vbTab & "displays logon info of specific ip" & vbCRLF & _
"find <partial ip/name>" & vbTab & "finds a user or ip" & vbCRLF & _
"follow" & vbTab & "follow hub logon actions" & vbCRLF & _
"stop" & vbTab & "stop following" & vbCRLF & _
"watch <user> [watcher]" & vbTab & "watches a specific user and messages watcher when he/she logs on" & vbCRLF & _
"message <user> [message]" & vbTab & "leaves a message to a specific user when he/she logs on" & vbCRLF & _
"let <user>" & vbTab & "lets one user to come freely to hub without restrictions" & vbCRLF & _
"findfake" & vbTab & "tries to find suspicious users" & vbCRLF & _
"findslots" & vbTab & "tries to find users with free slots" & vbCRLF & _
"oplist" & vbTab & "displays operator list" & vbCRLF & _
"poweroplist" & vbTab &	"displays powerop list" & vbCRLF & _
"viplist" & vbTab & "displays VIP userlist" & vbCRLF & _
"banlist" & vbTab & "displays list of banned users" & vbCRLF & _
"hubinfo" & vbTab & "displays hub settings" & vbCRLF & _
"share" & vbTab & "shows share limits" & vbCRLF & _
"setredirect <address>"	& vbTab & "sets hub redirect addresses (separate with comma)" & vbCRLF & _
"setmaxusers <amount>" & vbTab & "sets maximum user limit" & vbCRLF & _
"help" & vbTab & "shows this help" & vbCRLF & _
End If 
Josh_J

aDe
Forum Moderator
Posts: 138
Joined: 2003-01-07 09:14
Location: SE
Contact:

Post by aDe » 2003-01-15 17:31

The last line should not have a "& _" in the end

and i think there are too many line continuations, try breaking it up into several parts and adding them together..

Josh_J
Posts: 11
Joined: 2003-01-14 22:22
Contact:

Great!!!!

Post by Josh_J » 2003-01-15 20:03

Hello again, It finally works in the script :D Thanks for all the help you guys and gals. I can't believe I was so stupid not to look at the last "& _" and notice that it doesn't go there. Oh well.. I appreciate the help you guys.


Thanks Again!!
Josh_J

aDe
Forum Moderator
Posts: 138
Joined: 2003-01-07 09:14
Location: SE
Contact:

Post by aDe » 2003-01-16 01:29

Paradox wrote:Just one small point to make. Ops and registered users don't fire NewUserConnected when they log in. Instead you must put that code in OpConnected (or something similar, check the help). Make sure you still check if they are an op though because ordinary registered users also fire that sub.
Hehe.. i forgot :)

Locked