IPB

Welcome Guest ( Log In | Register )

2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 
Closed TopicStart new topic
> .apply and .recruit combined, New type of script.
The-Black-Ninja
post Apr 17 2008, 01:02 PM
Post #1


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



CLICK HERE FOR THE FINISHED PLUGIN


I'm going to be making a sophisticated plugin that combines the .apply plugin idea and the recruit plugin. What it will do is:
  • Allow the enabling of applying by level, icon, %, etc.
  • Changing the criteria for the aspects above on-the-fly
  • If your clanmates "recruit" someone, the option will be there to check the potential recruit for any of the options previously listed
Since I don't own a ladder clan, I need a little advice. The part I'm stuck on is this:

If you set the icon wins level (25, 150, etc.), do you even need the other option to set by overall wins alone? Any other input would be greatly appreciated as I'm doing it for you guys smile.gif

Edit: Added a link to finished plugin and closed topic. -PhiX


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hero.A
post Apr 17 2008, 04:24 PM
Post #2


I Read The Trash Can
*

Group: Banned
Posts: 1
Joined: 1-October 07
From: I live in my stealthbox
Member No.: 29,291



That would be really sexy! I would help a tinee bit


--------------------
~ Mike/Hero (View my other profile for more information about how to contact me)
- - - - - - - -
Take a look at my forums! (Up and running!)
- - - - - - - -
Visit Clan R77
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Apr 17 2008, 04:37 PM
Post #3


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



Sweet, there's gonna be lots of testing required cause I'm going to have all kinds of checks to make sure you don't set stuff that condradicts other things.


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
1ruleyou
post Apr 17 2008, 09:03 PM
Post #4


Get Some!
***

Group: Members
Posts: 482
Joined: 26-September 06
From: Utah
Member No.: 8,948



I like the idea and im still working on learning VBS i can make simple scripts but if you need anything done or tested im willing to help. Just give me an assignment i guess.


--------------------
Latest: Tell me what you think by clicking on it!
IPB Image
A Graphics Forum! Talk about anything graphics!
-------Click it. You know you want to click it-----
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Apr 17 2008, 09:13 PM
Post #5


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



Okay great, well like I said before, I have no idea how these clans invite people. As I have it right now, here's how I have it:
  • Join By Icon on/off
  • Icon Race (can be Null for no preference)
  • Icon Needed (0 wins, 25 wins, 150 wins, etc.)
  • Include tournament icon yes/no
  • Tournament Icon needed (0 wins, 10 wins, etc.)
  • Join By Wins on/off
  • Wins Needed (will be read off battle.net)
  • Join by Percent on/off
  • Percent needed (will be read off battle.net)
  • Join by Level on/off
  • Level Needed (will be read off battle.net)
These are just the requirements. Is there anything to be added/removed?


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Akiri
post Apr 18 2008, 03:13 PM
Post #6


Jr. Member
**

Group: Members
Posts: 34
Joined: 30-August 07
Member No.: 28,388



For DotA its like...

Competitive Play?
->League Play
->Inhouse Play
TDA Safelisted? (Icon/DA Forums)
Prior Clans

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Apr 18 2008, 03:15 PM
Post #7


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



Interesting. Could you explain those a bit more?


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
HearthCore
post Apr 18 2008, 03:38 PM
Post #8


Full Member
***

Group: Members
Posts: 203
Joined: 13-November 06
From: Germany - NRW - Solingen
Member No.: 12,190



He didnt get the script idea..

Akiri, its for LADDER Clans not for DotA !
it gets its information from the battle.net homepage and the status You, as an entering person, have.

DotA things are recorded nowhere!


--------------------
GERMAN ONLY !
Letzes mal in einem EM - Pubby :
" Tut mir leid ... ich kann dir kein gold schenken. Ich brauch das Gold um gut zu sein ! "
IPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Apr 19 2008, 12:19 AM
Post #9


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



Massive headway:
  • I've done away with icons for now since people I've talked to are too confused by the theory; they've suggested I just get rid of icons altogether since wins generally means an icon.
  • The tournament stuff I haven't found on BNet's website, so that's out.
Next question:

What should I do about percent needed? Battle.Net has the percent to two decimals. If you want 50% for a requirement and the person has 49.97%, what should be done? Do I include some +/- a few percent or...?

This post has been edited by The-Black-Ninja: Apr 19 2008, 12:19 AM


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
#define
post Apr 19 2008, 12:30 AM
Post #10


Catastrophic failure
*****

Group: Moderators
Posts: 2,527
Joined: 1-December 06
From: Boise, ID
Member No.: 13,228



QUOTE(The-Black-Ninja @ Apr 19 2008, 12:19 AM) *

What should I do about percent needed? Battle.Net has the percent to two decimals. If you want 50% for a requirement and the person has 49.97%, what should be done? Do I include some +/- a few percent or...?

I would suggest taking the ceiling of the wins needed if you don't like decimal value for wins. So a player having 49.97% would need 1 win to get 50%. Ceiling means you always round up to the nearest whole number, never rounding down. 10.01 would be 11 for example.
But really it's completely a preference thing. Since it is impossible to obtain a fraction of a win and rounding down would result in a value < 50%... taking the ceiling seems the best option to me.

This post has been edited by #define: Apr 19 2008, 12:32 AM


--------------------
IPB Image
AIM: segfaultcritical
Please don't PM me with tech support questions issues, that is what the forum is for.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Apr 19 2008, 12:36 AM
Post #11


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



QUOTE(#define @ Apr 19 2008, 02:30 AM) *

I would suggest taking the ceiling of the wins needed if you don't like decimal value for wins. So a player having 49.97% would need 1 win to get 50%. Ceiling means you always round up to the nearest whole number, never rounding down. 10.01 would be 11 for example.
But really it's completely a preference thing. Since it is impossible to obtain a fraction of a win and rounding down would result in a value < 50%... taking the ceiling seems the best option to me.

I like that idea too. I was thinking it would be taken into effect when the requirement is, say 50% again, and the user has less than or equal to half a percent below, ie. 49.50% and upwards.

This post has been edited by The-Black-Ninja: Apr 19 2008, 12:37 AM


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hero.A
post Apr 19 2008, 05:29 PM
Post #12


I Read The Trash Can
*

Group: Banned
Posts: 1
Joined: 1-October 07
From: I live in my stealthbox
Member No.: 29,291



Thats not ceiling ninja. Thats just plain old CInt - Rounding


--------------------
~ Mike/Hero (View my other profile for more information about how to contact me)
- - - - - - - -
Take a look at my forums! (Up and running!)
- - - - - - - -
Visit Clan R77
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Pyro
post Apr 19 2008, 05:38 PM
Post #13


huh?
********

Group: Root Administrators
Posts: 9,073
Joined: 23-February 07
From: Orlando, Florida
Member No.: 19,243



QUOTE(Hero.A @ Apr 17 2008, 06:24 PM) *
That would be really sexy! I would help a tinee bit
You should fulfill prior commitments before taking on new ones.


--------------------
Pyro
Chieftain of Clan BoT.
Host of pyro.no-ip.biz
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Fusic
post Apr 19 2008, 07:09 PM
Post #14


Imagine.
*****

Group: Sr. Members
Posts: 1,109
Joined: 13-October 06
From: Edmonton, Alberta
Member No.: 10,200



I can help mate smile.gif

Learned lots more since we talked.


--------------------
IPB Image

IPB Image

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
ZaMaK
post Apr 19 2008, 08:51 PM
Post #15


Jr. Member
**

Group: Members
Posts: 40
Joined: 1-October 06
Member No.: 9,373



When will this be finished? Or is it?


--------------------
*)
..*).*)
(. (.'*ZaMaK*.*)
.*).*)..*).*)

IPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Apr 19 2008, 09:56 PM
Post #16


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



@Zamak: Probably will be finished by the end of the week, there's not much left to do.

@Fusic: Great. I'll post what I get done tonight on here before I go to bed. Have a look through and see if there's anything that needs adding or tweaking smile.gif


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
ZaMaK
post Apr 19 2008, 10:53 PM
Post #17


Jr. Member
**

Group: Members
Posts: 40
Joined: 1-October 06
Member No.: 9,373



Awesome. I'm really looking forward for this plugin =)


--------------------
*)
..*).*)
(. (.'*ZaMaK*.*)
.*).*)..*).*)

IPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Apr 20 2008, 04:48 PM
Post #18


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



Well, since no one's offered any input, here it is. Any bug or suggestions, post em. If I don't hear back, it's getting posted in the Scripting and Plugins forum as is.

This was done in Notepad++ so I had to put this back into Notepad and take out the ridiculous tabs. It looks kinda messy, but try to look past that laugh.gif

The script can be found here:
http://ninja.pastebin.com/m4a21def5

Look for the "download" link near the top of the script. Click and, click "Open" at the pop-up, and it should go right into Notepad or Word or whatever text editor you use.

That code will be up for roughly around a month, after which I will have to re-post it, so I would appreciate some feedback before then. Just some simple stuff, you don't actually HAVE to invite users, just like test out the commands, see what does what, look through it, etc.

This post has been edited by The-Black-Ninja: Apr 20 2008, 05:40 PM


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hero.A
post Apr 20 2008, 04:52 PM
Post #19


I Read The Trash Can
*

Group: Banned
Posts: 1
Joined: 1-October 07
From: I live in my stealthbox
Member No.: 29,291



Tested it some.

To Fix:
I can apply from in bot tongue.gif
On Inbot command use. it does not VetoThisMessage
-- [05:50:43 PM] You have been placed on the Recruit waiting list. Clan ABC will contact you ASAP.
-- [05:50:43 PM] That is not a valid command. Type /help or /? for more info.
I'll put more here as I go


--------------------
~ Mike/Hero (View my other profile for more information about how to contact me)
- - - - - - - -
Take a look at my forums! (Up and running!)
- - - - - - - -
Visit Clan R77
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Apr 20 2008, 05:12 PM
Post #20


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



Okay, I'll look into that. Thanks smile.gif

Fixed.


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Fusic
post Apr 20 2008, 05:16 PM
Post #21


Imagine.
*****

Group: Sr. Members
Posts: 1,109
Joined: 13-October 06
From: Edmonton, Alberta
Member No.: 10,200



You can't use inbot commands for things like "Delrecruit, Clear, AddRecruit, Rec"

Here is the code with that VetoThisMessage Working.


CODE
'recruit
'1.0
'&RecruitAndApply:The-Black-Ninja
'&rec autoinvite on/off:rec wins on/off:rec percent on/off:rec level on/off:rec setwins #:rec setpercent#.##:rec setlevel #:apply:read:delrecruit <user>:clear:addrecruit <user>
'&
'&The delrecruit command can also be used like this for multiple user removals; .delrecruit user1, user2, user3:If you see, in the ini file, "True" or "Ignored"; True = has been recruited successfully, Ignored = More than one attempt has been made to put the user on the recruit list, so the bot will ignore further attempts to prevent flooding.


'/***************
'* Commands *
'* *
'*************** /
Const recruit_admincmd = "rec" '// Command needed to initiate requirement settings
Const recruit_apply_cmd = "apply" '// Command for users to apply
Const recruit_read = "read" '// Command to read recruits on the list
Const recruit_remrecruit = "delrecruit" '// Command to delete recruits from the list
Const recruit_clear = "clear" '// Command to remove all recruits from the list
Const recruit_add = "addrecruit" '// Command to add recruits to the list - Clan members only

Const recruit_enableAutoInvite = "autoinvite" '// Command to enable/disable automatic invites upon passing requrement test. Followed by "on/off"
Const recruit_enableWins = "wins" '// Command to enable/disable win amount requrement test. Followed by "on/off"
Const recruit_enablepercent = "percent" '// Command to enable/disable win percent amount requrement test. Followed by "on/off"
Const recruit_enablelevel = "level" '// Command to enable/disable level requrement test. Followed by "on/off"

Const recruit_setWins = "setwins" '// Command to adjust win amount requrement. Followed by an integer
Const recruit_setpercent = "setpercent" '// Command to adjust win percent amount requrement. Followed by an integer
Const recruit_setlevel = "setlevel" '// Command to adjust level amount requrement. Followed by an integer


'/**************************
'* Settings and Access *
'* *
'**************************/
recruit_Path = BotPath & "plugins\recruit_List.ini" '// Holds the path to save the recruit list. Must be an ini file.
Const recruit_realm = "Azeroth" '// Your Realm
Const recruit_ClanTag = "ABC" '// Your Clan Tag

Const recruit_adminAccess = 50 '// Access for adjusting all requirements
Const recruit_adminFlags = "" '// Flags for adjusting all requirements

Const recruit_readAccess = 50 '// Access for reading recruit list
Const recruit_readFlags = "" '// Flags for reading recruit list

Const recruit_remAccess = 50 '// Access for removing a recruit from the list
Const recruit_remFlags = "" '// Flags for removing a recruit from the list

Const recruit_addAccess = 50 '// Access for adding a recruit to the list
Const recruit_addFlags = "" '// Flags for adding a recruit to the list

Const recruit_clearAccess = 500 '// Access for removing all recruits from the list
Const recruit_clearFlags = "" '// Flags for removing all recruits from the list

Const recruit_canInviteAccess = 60 '// Access for users who can Invite through the bot or through battle.net (ie. Shamans)
Const recruit_canInviteFlags = "" '// Flags for users who can Invite through the bot or through battle.net (ie. Shamans)



'/***********************
'* Code Begins Here *
'* *
'************************/

Public recruit_inUse, recruit_wins, recruit_level, recruit_percent
Set recruitFSO = CreateObject("Scripting.FileSystemObject")


Sub recruit_Event_Load()

SetSetting "recruit", "EnableAutoInvite", False, "False: if they pass, they will be placed in the Recruit List. True: if they pass, bot will auto-invite users.", False
SetSetting "recruit", "ApplyModeEnabled", False, "False: users will be placed directly in the Recruit List. True: bot will auto-detect requirements first.", False

SetSetting "recruit", "JoinByWins", False, "Is a Win amount required to join?", False
SetSetting "recruit", "WinsNeeded", "50", "How many wins?", False

SetSetting "recruit", "JoinByPercent", False, "Is a Win % required to join?", False
SetSetting "recruit", "PercentNeeded", "50", "What percentage?", False

SetSetting "recruit", "JoinByLevel", False, "Is a Level required to join?", False
SetSetting "recruit", "LevelNeeded", "10", "What Level?", False

If NOT recruitFSO.FileExists(recruit_Path) Then
Set File = recruitFSO.OpenTextFile(recruit_Path, 8, True)
File.WriteLine "[Recruits]"
File.Close
End If

recruit_inUse = False
End Sub


Sub recruit_Event_Userjoins(Username, Flags, Message, Ping, Product, Level, OriginalStatString, Banned)

GetDBEntry Username, myAccess, myFlags
If myAccess < recruit_canInviteAccess OR NOT InStr(LCase(myFlags), LCase(recruit_canInviteFlags)) Then Exit Sub
Set File = recruitFSO.OpenTextFile(recruit_Path, 1, True)
If File.AtEndOfStream Then
File.Close
Exit Sub
Else
content = Split(File.ReadAll, vb script:. Users must have X ladder wins to join.", Username, vb script:. Users do not need ladder wins to join.", Username, vb script:. Users must have X% to join.", Username, vb script:. Users do not need a percent to join.", Username, vb script:. Users must be at or above X Level to join.", Username, vb script:. Users do not need a Level to join.", Username, vb script:. Users will be automatically invited if they pass.", Username, vb script:. Users will be placed on the waiting list if they pass.", Username, vb script:. Ladder wins set to: " & arrCmd(2) & ".", Username, vb script:. Win % set to: " & arrCmd(2) & ".", Username, vb script:. Level set to: " & arrCmd(2) & ".", Username, vbOrange
End If
Else
Dsp dspId, ".:Recruit Script Error:. Level must be a valid integer.", Username, vbRed
Exit Sub
End If
End If
Else
Dsp dspId, ".:Recruit Script Syntax Error:. You did not specify an integer.", Username, vbRed
Exit Sub
End If
End If
End Select
End If

ElseIf arrCmd(0) = recruit_apply_cmd Then
If recruit_inUse Then
Dsp dspId, "Please wait. A user is already being validated...", Username, vbRed
Exit Sub
Else
If LCase(GetInternalDataByUsername(Username, 0)) <> vbNullString Then
Dsp dspId, Username & ", you must leave Clan " & GetInternalDataByUsername(Username, 0) & " before applying.", Username, vbRed
Exit Sub
ElseIf LCase(GetInternalDataByUsername(Username, 0)) = LCase(recruit_ClanTag) Then
Exit Sub
End If

If GetConfigEntry("Recruits", Username, recruit_Path) = "True" Then
Dsp dspId, Username & ", you are already on the Recruit waiting list. Please be patient...", Username, vbRed
WriteConfigEntry "Recruits", Username, "Ignored", recruit_Path
ElseIf GetConfigEntry("Recruits", Username, recruit_Path) = "Ignored" Then
Exit Sub
End If

If GetSetting("recruit", "ApplyModeEnabled") Then
If SciNet.StillExecuting Then
Dsp dspId, "The Bot is in use. Please try again in a few moments.", Username, vbRed
recruit_inUse = False
Exit Sub
End If

recruit_inUse = True
acceptGlobal = False
acceptWins = False
acceptLevel = False
acceptPercent = False
deny = False
denyMsg = vbNullString
acceptMsg = vbNullString
If GetConfigEntry("Recruits", Username, recruit_Path) = vbNullString Then
If GetSetting("recruit", "JoinByWins") Then
recruit_GetWins GetInternalDataByUsername(Username, 3), recruit_Realm, Username, dspId
If CInt(recruit_wins) < CInt(GetSetting("recruit", "WinsNeeded")) Then
denyMsg = denyMsg & "Your Wins (" & recruit_wins & ") must be equal to or greater than " & GetSetting("recruit", "WinsNeeded") & ", "
deny = True
Else
accept = True
End If
End If

If GetSetting("recruit", "JoinByPercent") Then
recruit_GetPercent GetInternalDataByUsername(Username, 3), recruit_Realm, Username, dspId
If CInt(recruit_percent) < CInt(GetSetting("recruit", "PercentNeeded")) Then
denyMsg = denyMsg & "Your Percent (" & recruit_percent & ") must be equal to or greater than " & GetSetting("recruit", "PercentNeeded") & ", "
deny = True
Else
accept = True
End If
End If

If GetSetting("recruit", "JoinByLevel") Then
recruit_GetLevel GetInternalDataByUsername(Username, 3), recruit_Realm, Username, dspId
If CInt(recruit_level) < CInt(GetSetting("recruit", "LevelNeeded")) Then
denyMsg = denyMsg & "Your Level (" & recruit_level & ") must be equal to or greater than " & GetSetting("recruit", "LevelNeeded") & ", "
deny = True
Else
accept = True
End If
End If

If deny Then
Dsp dspId, Left(denyMsg, Len(denyMsg) - 2) & ".", Username, vbGreen
recruit_inUse = False
Exit Sub
End If

If accept Then
If acceptPercent Then acceptMsg = acceptMsg & "Percent (" & recruit_percent & ") accepted, "
If acceptLevel Then acceptMsg = acceptMsg & "Level (" & recruit_level & ") accepted, "
If acceptWins Then acceptMsg = acceptMsg & "Wins (" & recruit_wins & ") accepted, "
If GetSetting("recruit", "EnableAutoInvite") Then
Dsp dspId, Left(acceptMsg, Len(acceptMsg) - 2) & ". Auto-inviting " & Username & "...", Username, vbGreen
If Username = BotVars.Username And Left(Message, 1) = "/" Then VetoThisMessage
Command BotVars.Trigger, "/invite " & Username, True
Else
Dsp dspId, Left(acceptMsg, Len(acceptMsg) - 2) & ". You have been placed on the Recruit waiting list. Clan " & recruit_ClanTag & " will contact you ASAP.", Username, vbGreen
WriteConfigEntry "Recruits", Username, "True", recruit_Path
End If
End If
End If
Else
Dsp dspId, "You have been placed on the Recruit waiting list. Clan " & recruit_ClanTag & " will contact you ASAP.", Username, vbGreen
WriteConfigEntry "Recruits", Username, "True", recruit_Path
End If
End If


ElseIf arrCmd(0) = recruit_read Then

If Username = BotVars.Username And Left(Message, 1) = "/" Then VetoThisMessage
If myAccess < recruit_readAccess OR NOT InStr(LCase(myFlags), LCase(recruit_readFlags)) And Username <> BotVars.Username Then Exit Sub
Set File = recruitFSO.OpenTextFile(recruit_Path, 1, True)
If File.AtEndOfStream Then
File.Close
Dsp dspId, "There are no recruits waiting for approval.", Username, vbGreen
Exit Sub
End If
content = Split(File.ReadAll, vbCrLf)
File.Close
x = 0
For i = 0 To UBound(content) - 1
x = x + 1
If InStr(content, "=") Then output = output & x & ". " & Split(content(i), "=")(0) & ", "
Next
If x = 1 Then
Dsp dspId, "There are no recruits waiting for approval.", Username, vbGreen
Else
Dsp dspId, "Recruits on the waiting list:", Username, vbGreen
Dsp dspId, Left(output, Len(output) - 2), Username, vbGreen
End If


ElseIf arrCmd(0) = recruit_remrecruit Then

If Username = BotVars.Username And Left(Message, 1) = "/" Then VetoThisMessage
If myAccess < recruit_remAccess OR NOT InStr(LCase(myFlags), LCase(recruit_remFlags)) And Username <> BotVars.Username Then Exit Sub
If UBound(arrCmd) < 1 Then
Dsp dspId, "Proper format: " & BotVars.Trigger & recruit_remrecruit & " " & Username, Username, vbGreen
Else
If InStr(arrCmd(1), ", ") Then
users = Split(arrCmd(1), ", ")
For i = 0 To UBound(users) - 1
WriteConfigEntry "Recruits", users(i), vbNullString, recruit_Path
Next
Dsp dspId, "Users have been removed from the Recruit List.", Username, vbGreen
Else
WriteConfigEntry "Recruits", arrCmd(1), vbNullString, recruit_Path
Dsp dspId, arrCmd(1) & " has been removed from the Recruit List.", Username, vbGreen
End If
End If


ElseIf arrCmd(0) = recruit_add Then

If Username = BotVars.Username And Left(Message, 1) = "/" Then VetoThisMessage
If myAccess < recruit_addAccess OR NOT InStr(LCase(myFlags), LCase(recruit_addFlags)) And Username <> BotVars.Username Then Exit Sub
If UBound(arrCmd) < 1 Then
Dsp dspId, "Proper format: " & BotVars.Trigger & recruit_add & " " & Username, Username, vbGreen
Else
If LCase(GetInternalDataByUsenrame) <> LCase(recruit_ClanTag) Then Exit Sub
If GetConfigEntry("Recruits", arrCmd(1), recruit_Path) = "True" Then
Dsp dspId, arrCmd(1) & ", is already on the Recruit waiting list. Please be patient...", Username, vbRed
WriteConfigEntry "Recruits", arrCmd(1), "Ignored", recruit_Path
Exit Sub
ElseIf GetConfigEntry("Recruits", arrCmd(1), recruit_Path) = "Ignored" Then
Exit Sub
End If
WriteConfigEntry "Recruits", arrCmd(1), "True", recruit_Path
Dsp dspId, arrCmd(1) & " has been added to the Recruit List.", Username, vbGreen
End If


ElseIf arrCmd(0) = recruit_clear Then

If Username = BotVars.Username And Left(Message, 1) = "/" Then VetoThisMessage
If myAccess < recruit_clearAccess OR NOT InStr(LCase(myFlags), LCase(recruit_clearFlags)) And Username <> BotVars.Username Then Exit Sub
If recruitFSO.FileExists(recruit_Path) Then recruitFSO.DeleteFile(recruit_Path)
Dsp dspId, "Recruit list has been cleared.", Username, vbGreen
Set File = recruitFSO.OpenTextFile(recruit_Path, 8, True)
File.WriteLine "[Recruits]"
File.Close
End If
End Sub



Public Function recruit_GetWins(rwinsProd, rwinsRealm, rwinsUser, htr)

content = SciNet.OpenURL("http://www.battle.net/war3/ladder/" & rwinsProd & "-player-profile.aspx?Gateway=" & rwinsRealm & "&PlayerName=" & rwinsUser)
data = Split(Split(content, ">Total:<")(1), "</TR>")(0)
data = Split(data, vbNewLine)
For i = 1 To 1
rWins = data(i)
Next
rWins = Split(Split(rWins, """>")(1), "<")(0)
recruit_wins = rWins
End Function


Public Function recruit_GetPercent(rprcntProd, rprcntRealm, rprcntUser, htr)

content = SciNet.OpenURL("http://www.battle.net/war3/ladder/" & rprcntProd & "-player-profile.aspx?Gateway=" & rprcntRealm & "&PlayerName=" & rprcntUser)
data = Split(Split(content, ">Total:<")(1), "</TR>")(0)
data = Split(data, vbNewLine)
For i = 3 To 3
rPrcnt = data(i)
Next
rPrcnt = Split(Split(rPrcnt, """>")(1), "<")(0)
rPrcnt = Replace(rPrcnt, "%", vbNullString)
recruit_percent = rPrcnt
End Function


Public Function recruit_GetLevel(rlvlProd, rlvlRealm, rlvlUser, htr)

sString = StrReverse(GetInternalDataByUsername(rlvlUser, 5))
recruit_level = Split(sString, " ")(1)
End Function


--------------------
IPB Image

IPB Image

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Apr 20 2008, 05:26 PM
Post #22


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



...Why did you just do that? You're not supposed to even be able to use it inbot.

That's why I replied back with "Fixed."

This post has been edited by The-Black-Ninja: Apr 20 2008, 05:28 PM


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Fusic
post Apr 20 2008, 05:26 PM
Post #23


Imagine.
*****

Group: Sr. Members
Posts: 1,109
Joined: 13-October 06
From: Edmonton, Alberta
Member No.: 10,200



Do what? I didn't add those commands.

I fixed the Bnet message Hero was getting?

Message me on MSN.

This post has been edited by Fusic: Apr 20 2008, 05:27 PM


--------------------
IPB Image

IPB Image

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Apr 20 2008, 05:30 PM
Post #24


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



QUOTE(Fusic @ Apr 20 2008, 07:26 PM) *

I fixed the Bnet message Hero was getting?

I've already fixed that message.
QUOTE(Fusic @ Apr 20 2008, 07:26 PM) *

Message me on MSN.

This is called group projects for a reason tongue.gif


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Fusic
post Apr 20 2008, 05:32 PM
Post #25


Imagine.
*****

Group: Sr. Members
Posts: 1,109
Joined: 13-October 06
From: Edmonton, Alberta
Member No.: 10,200



Oh didn't see you edited it to the main post so I just posted my code that I tested right quick smile.gif

This post has been edited by Fusic: Apr 20 2008, 05:32 PM


--------------------
IPB Image

IPB Image

User is offlineProfile CardPM
Go to the top of the page
+Quote Post
ZaMaK
post Apr 20 2008, 05:37 PM
Post #26


Jr. Member
**

Group: Members
Posts: 40
Joined: 1-October 06
Member No.: 9,373



Is this ready?
( i just read there were problems in above comments)
Post the fixed code when it is =)


--------------------
*)
..*).*)
(. (.'*ZaMaK*.*)
.*).*)..*).*)

IPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Apr 21 2008, 03:39 PM
Post #27


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



QUOTE(ZaMaK @ Apr 20 2008, 07:37 PM) *

Is this ready?
( i just read there were problems in above comments)
Post the fixed code when it is =)

Why don't you use it and see if you can find any bugs or problems? wink.gif

Well, if no one has anything to say about it, I'm going to put this in Scripting and Plugins.


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
riffruff
post Apr 21 2008, 04:22 PM
Post #28


I riffruff
********

Group: Sr. Members
Posts: 3,727
Joined: 19-February 06
From: USA
Member No.: 278



As a coding suggestion...

I would suggest making a sub for every command...This makes editing the script easier, as all you have to do is modify a sub and don't have to worry about messing something up...It also cleans the code up a bit -- having command processing in one location, and having command performance in another location...

This makes it easier to add new commands, and to edit exist commands...

This post has been edited by riffruff: Apr 21 2008, 04:22 PM


--------------------
What you should tell your girlfriend...
QUOTE
ALL men see in only 16 colors, like Windows default settings. Peach, for example, is a fruit, not a color. Pumpkin is also a fruit. We have no idea what mauve is.

QUOTE
Women, learn to work the toilet seat. You're a big girl. If it's up, put it down. We need it up, you need it down. You don't hear us complaining about you leaving it down.

http://riffruff.mybrute.com
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
The-Black-Ninja
post Apr 21 2008, 07:42 PM
Post #29


Pure Sex
********

Group: Moderators
Posts: 7,756
Joined: 13-August 06
Member No.: 7,372



Thanks Riff, I'll work on this for the next update/release.


--------------------
IPB Image

-My Plugins :: Thanks Pyro :)
IPB ImageIPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Closed TopicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 21st July 2019 - 03:04 PM
Skin by Andrea
Website Legal Information | Hosted by LunarPages