StealthBot.net: Clan Rank Script (crs) - StealthBot.net

Jump to content

  • (9 Pages)
  • +
  • « First
  • 6
  • 7
  • 8
  • 9
  • You cannot start a new topic
  • You cannot reply to this topic

Clan Rank Script (crs)

#176 User is offline   The-Black-Ninja Icon

  • The Sex
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,526
  • Joined: August-01 09

Posted August 05, 2010 - 08:33 PM

It's in the scripts.ini, [crs] section.

#177 User is offline   M.Methven Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: September-12 09

Posted August 10, 2010 - 12:39 AM

Hi TBN, I need help with this section of code. The Auto-Promote does NOT work as previously stated in another post I read. Same thing as his post, all mine does is keep promoting them each time they rejoin the channel.

Private Sub AutoPromote(Username)  '// Auto-promots users based on Days in Clan or Number of Recruits

   Set rs = crsConn.Execute("SELECT COUNT(*) FROM `members` WHERE `name`='" & Username & "'")

   If rs.Fields(0) <> 0 Then
      If GetSettingsEntry("dayPromote_on") Then
         dic = GetDaysInClan(Username)
         Set rs = crsConn.Execute("SELECT `rank`, `promotion_date` FROM `members` WHERE `name` = '" & Username & "'")
         cRank = rs.Fields(0)
         pDate = rs.Fields(1)

         dLower = Int(GetSettingsEntry("dayLowRank"))
         dUpper = Int(GetSettingsEntry("dayHighRank"))
         dIncrement = Int(GetSettingsEntry("dayIncrement"))

         dLimit = dLower - dUpper

        '// If they're joining the channel that's a multiple of the dIncrement and they've been in the clan for longer than 0 days
         If dic MOD dIncrement = 0 AND dic > 0 Then
           '// If their rank is less than the max and equal to or greater than the lowest
            If cRank > dUpper AND (cRank => dLower OR (cRank < dLower AND cRank =< dLower-1)) Then
              '// If they've been in the clan for an extended period of time, but are within the auto-promotion limits, give promotion based on "days since last promotion"
               If (dic/dIncrement) > dLimit Then
                  pDiff = DateDiff("d", pDate, Now)
                  If pDiff MOD dIncrement = 0 Then
                     If pDiff-(dic/dIncrement) < dUpper Then
                        AddChat 16759296, "CRS Script:. ", 10682112, Username & " has been in the clan for " & dic & " days, but is ranked within auto-promote limits. System will auto-promote user every " & dIncrement & " days from their last promotion date."
                        AddChat 16759296, "CRS Script:. ", 10682112, Username & " was last promoted " & DateDiff("d", pDate, Now) & " days ago and was ranked " & crsRanks(cRank) & ". Auto promoting to " & crsRanks(cRank-(pDiff/dIncrement)) & " (maximum)."
                        Command BotVars.Username, "/crsPromote " & Username & " " & pDiff/dIncrement & " Was last promoted " & pDiff & " days ago.", True
                     Else
                        AddChat 16759296, "CRS Script:. ", 10682112, Username & " has been in the clan for " & dic & " days, but is ranked within auto-promote limits. System will auto-promote user every " & dIncrement & " days from their last promotion date."
                        AddChat 16759296, "CRS Script:. ", 10682112, Username & " was last promoted " & DateDiff("d", pDate, Now) & " days ago and was ranked " & crsRanks(cRank) & ". Auto promoting to " & crsRanks(cRank-(pDiff/dIncrement)) & "."
                        Command BotVars.Username, "/crsPromote " & Username & " " & pDiff/dIncrement & " Was last promoted " & pDiff & " days ago.", True
                     End If
                  End If
               Else
                 '// If their rank-to-be is less than the max
                  If cRank-(dic/dIncrement) < dUpper Then
                     AddChat 16759296, "CRS Script:. ", 10682112, Username & " has been in the clan for " & dic & " days and was ranked " & crsRanks(cRank) & ". Auto promoting to " & crsRanks(dUpper) & " (maximum)."
                     Command BotVars.Username, "/crsPromote " & Username & " " & cRank-dUpper & " Has been in the clan for " & dic & " days.", True
                  Else
                     AddChat 16759296, "CRS Script:. ", 10682112, Username & " has been in the clan for " & dic & " days and was ranked " & crsRanks(cRank) & ". Auto promoting to " & crsRanks(cRank-(dic/dIncrement)) & "."
                     Command BotVars.Username, "/crsPromote " & Username & " " & dic/dIncrement & " Has been in the clan for " & dic & " days.", True
                  End If
               End If
            End If
         End If
      End If


Please help TBN, I only want my members promoted/demoted a certain number of days from thier last promotion or demotion date.

Thanks,
M.Methven

#178 User is offline   The-Black-Ninja Icon

  • The Sex
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,526
  • Joined: August-01 09

Posted August 10, 2010 - 02:19 AM

Give me a few days to get a better system.. Tell me, does it happen when; new users join are are getting promoted every time they enter the channel, or users who have spent a long time in the clan, but get put into the autopromote area and they get promoted up to the very top?

Yeah I think I know what the confusion was. I was getting too caught up with making sure people got promoted based on days being in the clan, but when they've been there enough, start basing it off days since last promotion. I just now realized that if people put users into that auto-promote area, they don't care about days in the clan, they care that users will be promoted regularly since the last promotion/demotion date.

If I'm correct, please let me know because if I'm right, this problem is solved within hours lol has already been solved.

#179 User is offline   M.Methven Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: September-12 09

Posted August 10, 2010 - 08:07 AM

My whole ranking system is supposed to be based around time and its very useful to have your auto promote/demote function. I have the following settings

'//  Demotes users with X days of last logging into the channel.
dsllLimit=30
'//  Enable auto-demote based on days of last channel log in.
dsll_on=True
'//  Every X days (dayIncrement) in the clan, users will be promoted starting from the numerical rank of dayLowRank, stopping at dayHighRank
'//  Disable this system by setting dayPromote_on to False
dayPromote_on=True
dayHighRank=2
dayLowRank=29
dayIncrement=20


The problem is if I want people promoted every 20 days, they are being promoted each and every time they enter the channel after they have reached 20+ days. After the first promotion they shouldn't get another promotion for another 20 days but thats not happening. Thus when a new member hits his 20 day promotion mark, he then will hit the highest possible rank in no time at all just by rejoining the channel after games.

Thanks for your help TBN, it's much appreciated,
M.Methven

#180 User is offline   The-Black-Ninja Icon

  • The Sex
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,526
  • Joined: August-01 09

Posted August 10, 2010 - 08:12 PM

Then in that case, the changes I made last night have fixed the problem. I'll post an updated version tonight.

#181 User is offline   The-Black-Ninja Icon

  • The Sex
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,526
  • Joined: August-01 09

Posted August 10, 2010 - 10:30 PM

Alrighty, updated first post. Try the auto-promote now. It should only promote on multiples of the dayincrement (so if day increments are set to 5, it will promote every 5 days) and it should not re-promote or attempt to promote if they rejoin the channel the same day as their auto-promote. If it's been, say, 10 days since the bot last saw them and increments are set to 5, it will promote them 2 ranks so they won't be cheated.

I've tested it as best as I could on my own.

#182 User is offline   iTzCHiLL Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: August-05 10

Posted August 11, 2010 - 12:23 AM

Can u make the greet not in a whisper? Or is that not possible?

#183 User is offline   The-Black-Ninja Icon

  • The Sex
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,526
  • Joined: August-01 09

Posted August 11, 2010 - 01:08 AM

Look in your scripts.ini. More specifically, check the FAQ

http://www.stealthbo.../#FAQ_GreetType

#184 User is offline   M.Methven Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: September-12 09

Posted August 14, 2010 - 06:48 AM

Thanks TBN, your update to the auto-promote function did indeed stop members from being promoted when they weren't supposed to. I have updated my script and have been watching it. I have yet to see it promote somebody, I've seen it demote members that haven't been online. I did however notice one flaw in how you have it setup now though. If I understand it correctly my members will be promoted on the 20th day or multiple of it. What if my members are not online on the 20th day or multiple of it? Does this mean they will miss out on being promoted until another 20 days pass, and then only if theyre online on that day? One more thing I was hoping for was a little bit more info from the following message, "You cannot demote someone that is an equal or higher rank than yourself, or below the lowest rank.". I find this message rather irritating, I would like to know who it was trying promote or demote and which ranks it was trying to promote or demote them from and to.

Thanks for your time and effort TBN, you do a great job on these scripts. I read your profile, congrats on learning. I wish I could write all of these things myself, I'm in the processes of trying to learn by looking at other scripts and these changes youv'e been making.

M.Methven

#185 User is offline   The-Black-Ninja Icon

  • The Sex
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,526
  • Joined: August-01 09

Posted August 14, 2010 - 12:10 PM

Thanks for that, that means a lot to me :)

In answer, if they miss a promotion day, they will have to wait another X days to get promoted, but they will get promoted to where they should be, so they aren't getting screwed. Actually, I think I know a way to fix this. I'm out all day today, so hopefully tomorrow or Monday I can work on this.

#186 User is offline   lpm_ga21 Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: August-02 10

Posted August 16, 2010 - 08:13 AM

Hi, I used the CRS before, when it had the auto-promote issue. i stopped using it and today I saw you released a new update. I took the old CRS script out and replace with the new one and edited accordingly. However, NONE of the CMDS work at all, I dont know how to add user to the crs db via console either.

EDIT: Nevermind. working as soon as i posted this. had to be my boogieman again.. damn you boogiewoogie

This post has been edited by lpm_ga21: August 16, 2010 - 08:16 AM


#187 User is offline   The-Black-Ninja Icon

  • The Sex
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,526
  • Joined: August-01 09

Posted September 16, 2010 - 12:20 AM

Update!

If this is your first time downloading the CRS script, ignore this post.


Existing users; open up your scripts.ini and in the CRS section, you'll see this entry:

Quote

'// Enable CRS auto-access so when users are promoted to different ranks, their access will be automatically adjusted according to each rank's access setting.
aa_on=False

Add this new setting below that entry:

Quote

'// Enable CRS auto-access so when users are promoted to different ranks, their access will be automatically adjusted according to each rank's access setting.
aa_on=False
'// Enable CRS auto-access removal so when users are removed from the CRS database, their entry in the bot's Database Manager will also be removed.
aa_rem_on=False


#188 User is offline   DaveTheBat Icon

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

Posted September 16, 2010 - 07:58 AM

Doesn't seem to work. Have reloaded the Config, and scripts.

 [09:55:19 AM] " pro-acc " has been removed from the CRS database.
 [09:55:34 AM] -- Nightwishing has left the channel.
 [09:55:34 AM] That user is not logged on.
 [09:55:38 AM] <ClanVFRBot> Nightwishing has logged off battle.net.
 [09:55:44 AM] " PRO-ACC " has been added as a new member with the rank of 3 - 3: Hostbot Admins


He's still in the database and still got the same access as he had before.

If I add them it wont give them their specific access either.
Do not know what have happened.
ClanVFRBot: Posted Image

#189 User is offline   The-Black-Ninja Icon

  • The Sex
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,526
  • Joined: August-01 09

Posted September 16, 2010 - 12:05 PM

I know what happened; you didn't download the new version.

#190 User is offline   DaveTheBat Icon

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

Posted September 16, 2010 - 12:59 PM

Oh. I must have misunderstood your post then, lol. ^^

Now when I do /crsremove it gives me this error:

 [02:57:36 PM] That is not a valid command. Type /help or /? for more info.
 [02:57:44 PM] Scripting runtime error '438' in crs: (line 674; column 38)

ClanVFRBot: Posted Image

#191 User is offline   The-Black-Ninja Icon

  • The Sex
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,526
  • Joined: August-01 09

Posted September 16, 2010 - 01:11 PM

Isn't line 674 an End If?

Ohhh gay, hang on.

Okay, re-download. It was the problem with using Command for the actual command object and using Command for the bot to use an internal command.

#192 User is offline   DaveTheBat Icon

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

Posted September 16, 2010 - 01:20 PM

No error.
Thou he's still in the Member Database.
And he didn't get asigned a new access when I added him/deleted him again.
ClanVFRBot: Posted Image

#193 User is offline   The-Black-Ninja Icon

  • The Sex
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,526
  • Joined: August-01 09

Posted September 16, 2010 - 01:38 PM

If aa_rem_on is set to True, the Command BotVars.Username, "/rem " & name, True should be removing him when you remove him from the CRS DB.

#194 User is offline   DaveTheBat Icon

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

Posted September 16, 2010 - 01:40 PM

Well it doesn't seem to work.

I have tried everything I can think of.
And he's still in the database.

Just to clearify it's the Member Database not the CRS database I want them to be removed from.

And also what's the name of the Member Databse database? I want to delete everyone.

This post has been edited by DaveTheBat: September 16, 2010 - 01:52 PM

ClanVFRBot: Posted Image

#195 User is offline   The-Black-Ninja Icon

  • The Sex
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,526
  • Joined: August-01 09

Posted September 16, 2010 - 01:56 PM

Quote

/crsset test 5
[09:55:08 AM] " test " has had their rank changed to rank 5 - Eliminator

/crsremove test
[09:55:38 AM] Successfully removed database entry "test".
[09:55:38 AM] " test " has been removed from the CRS database.

/whois test
[09:56:42 AM] There was no such user found.

scripts.ini:

Quote

'// Enable CRS auto-access so when users are promoted to different ranks, their access will be automatically adjusted according to each rank's access setting.
aa_on=False
'// Enable CRS auto-access removal so when users are removed from the CRS database, their entry in the bot's Database Manager will also be removed.
aa_rem_on=True


The members database is users.txt

#196 User is offline   DaveTheBat Icon

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

Posted September 16, 2010 - 01:58 PM

Hmm could it be because I have most commands on disabled?
And thanks to that it cant delete them or change their access maybe?

Tried to change my .ini to that and didn't work.

OK! The reason why it didn't work was because I disabled most commands, now I changed them to -1 (which I guess means only in interface)?
Thou it's not adding the access to it yet, which command handles access?

This post has been edited by DaveTheBat: September 16, 2010 - 02:03 PM

ClanVFRBot: Posted Image

#197 User is offline   The-Black-Ninja Icon

  • The Sex
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,526
  • Joined: August-01 09

Posted September 16, 2010 - 02:01 PM

Then I'm not sure what to tell you. If your crsremove sub looks like this:
Private Sub crsremoveCmd(cmd, user)

   If cmd.IsValid Then
      If cmd.HasAccess Then
         If NOT IsCRSMember(user) Then Exit Sub
         name = cmd.Args

         Set rs = crsConn.Execute("SELECT COUNT(*) FROM `members` WHERE `name`='" & name & "'")
         If rs.Fields(0) <> 0 Then
            If NOT IsAlterValid("remove", name, user, vbNullString) Then
               cmd.Respond "You cannot remove someone equal to or higher than your current CRS rank."
               Exit Sub
            End If

            crsConn.Execute("DELETE FROM `members` WHERE `name`='" & name & "'")
            cmd.Respond """ " & name & " "" has been removed from the CRS database."
            If GetSettingsEntry("aa_rem_on") Then Command BotVars.Username, "/rem " & name, True
         Else
            cmd.Respond """ " & name & " "" does not have a record on the CRS database."
         End If
      End If
   End If
End Sub
Then it should work.

#198 User is offline   DaveTheBat Icon

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

Posted September 16, 2010 - 02:08 PM

Remove is now working.

But it doesn't give them any access.
That's the problem now.

EDIT: The problem were that I had disabled the /rem command. /add command is now also active but it doesn't give them any access.

This post has been edited by DaveTheBat: September 16, 2010 - 02:09 PM

ClanVFRBot: Posted Image

#199 User is offline   The-Black-Ninja Icon

  • The Sex
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,526
  • Joined: August-01 09

Posted September 16, 2010 - 02:18 PM

So change aa_on to True in the scripts.ini. The set command must be enabled.

Good find though, I never thought of that problem. I'll add that to the FAQ when I get a chance.

#200 User is offline   DaveTheBat Icon

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

Posted September 16, 2010 - 02:20 PM

D'oh!
Ha ha, I feel so stupid now.

Thanks! You're awesome Ninja!
ClanVFRBot: Posted Image

  • (9 Pages)
  • +
  • « First
  • 6
  • 7
  • 8
  • 9
  • 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