StealthBot.net: AFK script - StealthBot.net

Jump to content

  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

AFK script

#1 User is offline   The-Black-Ninja Icon

  • The Sex
  • Icon
  • Group: Scripting Moderators
  • Posts: 2,526
  • Joined: August-01 09

Posted September 08, 2009 - 04:06 AM

AFK (Away From Keyboard)

Author: The-Black-Ninja
Version: 1.32 Revision 0
Description: Sets users as AFK (Away From Keyboard) using a variety of methods.

Commands:

afk (reason) = Sets a user as AFK, can include a reason but not required. 40 access.
noafk
= Removes the user from AFK status. 40 access.
afkList
[name / reason / num] = Displays AFK users by; name, name & reason, or numerically. 200 access.
afkListNick [username] = Displays AFK nicknames for a user. 200 access.
afkNick [add / del / erase] = Adds a nickname for a user, deletes a nickname from the user, or erases all nicknames for a user - See the Command Manager for further explanation. 200 access.



Example Usages:
See the Command Manager inside the bot.



Important Notes:
  • You MUST REMOVE your AFK PLUGIN from your /plugins folder to avoid conflicts.
  • All settings can be edited in the scripts.ini file, under the [afk] section.
  • It is strongly recommended that you look through the INI to see all the settings available and look at the Command Manager for information on the commands themselves.

Attached File(s)

  • Attached File  AFK.txt (21.88K)
    Number of downloads: 1134


#2 User is offline   DaveTheBat Icon

  • Leader of VFR
  • PipPipPip
  • Group: Members
  • Posts: 152
  • Joined: September-28 09

Posted October 15, 2009 - 02:58 PM

It seems as if the afk script doesn't recognise people as afk if they haven't done anything for 5 minutes as I have put it.

To clearify: User is in channel doing nothing for the set amount of time (5 min) the bot should add him to the afklist but doesn't.
ClanVFRBot: Posted Image

#3 User is offline   Style Icon

  • King of TBR
  • PipPipPip
  • Group: Members
  • Posts: 135
  • Joined: October-09 09

Posted October 15, 2009 - 04:11 PM

the afkTimer_Timer() Sub must not be Private.
private Timer Subs don't work
Best Regards,
Style

Posted Image

#4 User is offline   The-Black-Ninja Icon

  • The Sex
  • Icon
  • Group: Scripting Moderators
  • Posts: 2,526
  • Joined: August-01 09

Posted October 15, 2009 - 06:38 PM

Yeah, that was my fault. My eye kept going to all the private subs I wrote so that's why I made the mistake. It's been fixed now.

#5 User is offline   DaveTheBat Icon

  • Leader of VFR
  • PipPipPip
  • Group: Members
  • Posts: 152
  • Joined: September-28 09

Posted October 15, 2009 - 07:22 PM

The script is still not working properly.
I got 8 users on the list and 6 of them ain't in the channel.
ClanVFRBot: Posted Image

#6 User is offline   The-Black-Ninja Icon

  • The Sex
  • Icon
  • Group: Scripting Moderators
  • Posts: 2,526
  • Joined: August-01 09

Posted October 15, 2009 - 07:33 PM

What version do you have? I would suggest re-downloading it.

#7 User is offline   DaveTheBat Icon

  • Leader of VFR
  • PipPipPip
  • Group: Members
  • Posts: 152
  • Joined: September-28 09

Posted October 15, 2009 - 07:37 PM

I did re-download it from the main post.
The problem is still there, it adds everyone that joins the channel to the afklist apparently.

This post has been edited by DaveTheBat: October 15, 2009 - 07:47 PM

ClanVFRBot: Posted Image

#8 User is offline   The-Black-Ninja Icon

  • The Sex
  • Icon
  • Group: Scripting Moderators
  • Posts: 2,526
  • Joined: August-01 09

Posted October 15, 2009 - 09:16 PM

I think I fixed it. Try it now.

#9 User is offline   DaveTheBat Icon

  • Leader of VFR
  • PipPipPip
  • Group: Members
  • Posts: 152
  • Joined: September-28 09

Posted October 15, 2009 - 09:48 PM

I think it might be working now.
Not 100% certain yet thou, since no one has joined the channel yet.

Will announce the progress as soon as I get someone to join the channel.

EDIT: I think it's actually working! So far all good!
One joined and haven't been added to the list yet.
And it have gone 2 minutes.

This post has been edited by DaveTheBat: October 15, 2009 - 10:00 PM

ClanVFRBot: Posted Image

#10 User is offline   The-Black-Ninja Icon

  • The Sex
  • Icon
  • Group: Scripting Moderators
  • Posts: 2,526
  • Joined: August-01 09

Posted October 15, 2009 - 10:12 PM

The default in the scripts.ini is set for 10 minutes, in the [afk] section, so if you want to change it to 2 minutes, replace the 10 with a 2 and save it. You won't need to reload the script.

#11 User is offline   DaveTheBat Icon

  • Leader of VFR
  • PipPipPip
  • Group: Members
  • Posts: 152
  • Joined: September-28 09

Posted October 15, 2009 - 10:16 PM

Yeah I know, I was just meaning that the script worked and I had changed it already to 5 minutes.
And since no one was added except the two that was afk for 5 minutes, it's all good.

Thanks for your time updating this very handy script. :)
ClanVFRBot: Posted Image

#12 User is offline   The-Black-Ninja Icon

  • The Sex
  • Icon
  • Group: Scripting Moderators
  • Posts: 2,526
  • Joined: August-01 09

Posted October 15, 2009 - 10:17 PM

You're welcome! Thanks for finding the bug :D lol

#13 User is offline   Tinnvec Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: October-09 09

Posted October 17, 2009 - 02:48 AM

Hello, I hate to post a bug my first post on the forums, but it seems as though changing the access levels for the commands breaks them somehow. Otherwise its a great script :)

#14 User is offline   The-Black-Ninja Icon

  • The Sex
  • Icon
  • Group: Scripting Moderators
  • Posts: 2,526
  • Joined: August-01 09

Posted October 17, 2009 - 03:51 AM

The changing of access for the commands through the command manager should not break the commands. What version of the bot are you using?

#15 User is offline   Novynn Icon

  • Silver Member
  • PipPipPipPipPip
  • Group: Senior Members
  • Posts: 873
  • Joined: October-07 09

Posted October 17, 2009 - 04:54 AM

Would you take a suggestion in this thread? If not, you can just delete my post.

Make is so that when you go afk, it records the time that you executed the command.
Then, when someone uses the ".afklist", it will tell them how long they have been in that state.

EXAMPLE without reason:
---
[8:00:39]<user1>: .afk
[8:00:39]<To user1> You have been marked as afk.
[8:07:42]<user2>: hey user1!
[8:08:05]<user2>: .afklist
[8:08:05]<To user2> AFK Users: user1 (8:00 pm)
---

EXAMPLE with reason:
---
[8:00:39]<user1>: .afk Dinner
[8:00:39]<To user1> You have been marked as afk (Dinner).
[8:07:42]<user2>: hey user1!
[8:08:05]<user2>: .afklist
[8:08:05]<To user2> AFK Users: user1 (Dinner - 8:00 pm)
---

It could get the time from BNet ("/time") and then translate that into the user's (user2) computers time.

This post has been edited by Neco: October 17, 2009 - 04:56 AM


#16 User is offline   The-Black-Ninja Icon

  • The Sex
  • Icon
  • Group: Scripting Moderators
  • Posts: 2,526
  • Joined: August-01 09

Posted October 17, 2009 - 05:19 AM

Good suggestion!! :) I kinda modified your suggestion; the script will give the minutes they've been AFK, instead of telling the actual time.

Updated.

#17 User is offline   DemonHunter Icon

  • Full Member
  • PipPipPip
  • Group: Members
  • Posts: 176
  • Joined: September-12 09

Posted October 17, 2009 - 05:47 AM

Nice, I really like that idea. Thx TBN for the update.

#18 User is offline   The-Black-Ninja Icon

  • The Sex
  • Icon
  • Group: Scripting Moderators
  • Posts: 2,526
  • Joined: August-01 09

Posted October 17, 2009 - 06:48 AM

Sorry guys, had to make a small fix; the timer that checks for afk users just kept adding people to the dictionary...which messed up the time they actually went afk because the time would always get overwritten, so that was fixed. I totally forgot that timer was so simplistic in what it was doing.

#19 User is offline   Novynn Icon

  • Silver Member
  • PipPipPipPipPip
  • Group: Senior Members
  • Posts: 873
  • Joined: October-07 09

Posted October 17, 2009 - 06:49 AM

Hooray, I hope it will make the script more enjoyable for others! :D

#20 User is offline   Tinnvec Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: October-09 09

Posted October 17, 2009 - 01:50 PM

View PostThe-Black-Ninja, on 16 October 2009 - 10:51 PM, said:

The changing of access for the commands through the command manager should not break the commands. What version of the bot are you using?


I'm using v2.7, the newest as far as I know. It still seems to be the same way in the newest version of the script (just downloaded before i posted this). Also, it seems that the afkListNick command doesn't work. I may be doing something wrong, but I really think I've got it all set up correctly.

#21 User is offline   Tinnvec Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: October-09 09

Posted October 17, 2009 - 03:04 PM

View PostTinnvec, on 17 October 2009 - 08:50 AM, said:

I'm using v2.7, the newest as far as I know. It still seems to be the same way in the newest version of the script (just downloaded before i posted this). Also, it seems that the afkListNick command doesn't work. I may be doing something wrong, but I really think I've got it all set up correctly.


I couldn't seem to edit my post, but I reinstalled stealthbot and everything works again lol. I must have messed something else up. The one thing I can't seem to get to work now are afk nick names. they get added to the list, but when the nick is said, the afk response doesn't trigger

#22 User is offline   The-Black-Ninja Icon

  • The Sex
  • Icon
  • Group: Scripting Moderators
  • Posts: 2,526
  • Joined: August-01 09

Posted October 17, 2009 - 06:04 PM

You'll need to make sure they have enough access to get a response when they use an AFK'd user's nickname. That setting is found in the scripts.ini, in the [afk] section.

#23 User is offline   Tinnvec Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: October-09 09

Posted October 17, 2009 - 07:21 PM

View PostThe-Black-Ninja, on 17 October 2009 - 01:04 PM, said:

You'll need to make sure they have enough access to get a response when they use an AFK'd user's nickname. That setting is found in the scripts.ini, in the [afk] section.


It's set to 0 currently:

[afk]
'// Idle time, in minutes, at which users will marked as AFK.
idle_time=5
'// These usernames will not be marked as AFK if they go idle. Separate multiple names with *; User1*user2*user3*etc
'// If you do not wish to have anyone exempt, leave the line as user1 or something random. Do not leave this line blank.
exempt_users=user1
'// If True, talking 3 times within 10 seconds will remove user's AFK status.
talk_rem_afk=True
'// Access required to recieve an auto-response after typing an afk user's nickname in the channel.
mention_resp_access=0



#24 User is offline   VJain Icon

  • Nobody
  • PipPip
  • Group: Members
  • Posts: 33
  • Joined: September-10 09

Posted October 19, 2009 - 09:06 AM

Hi, just wondering if it's possible to have .afklist an alias of .afklist name or how to do it?

Thanks,
~VJ

#25 User is offline   The-Black-Ninja Icon

  • The Sex
  • Icon
  • Group: Scripting Moderators
  • Posts: 2,526
  • Joined: August-01 09

Posted October 19, 2009 - 09:23 PM

You aren't able to make aliases for the "name" part, unfortunately. What you can do, however, is open up your commands.xml, do a CTRL+F and find the command "afklist". Then, check this line out:
<argument name="name/reason/num" type="Word">
Change the name thing to whatever you want, then save:
<argument name="n/reason/num" type="Word">


  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users