major script problem
Moderator: Moderators
major script problem
okay some smart arse is jamming the scripts, and i dont know how it can possibley be stopped.#
the users have nm dc or whatever with no dc++ tag
but they are putting <V: 0.232> in just like that, numbers can be changed i guess, my point is.
when the script see's <V:
it does a dc++ check.....
but with no H: or S:
it crashes because there is no beforefirst and no afterlast
see what i mean.....
anyone got a simple fix i can slap in dataarrival
thanks
the users have nm dc or whatever with no dc++ tag
but they are putting <V: 0.232> in just like that, numbers can be changed i guess, my point is.
when the script see's <V:
it does a dc++ check.....
but with no H: or S:
it crashes because there is no beforefirst and no afterlast
see what i mean.....
anyone got a simple fix i can slap in dataarrival
thanks
ashes to ashes, dust to dust, if the dope dont get you. The acid must
fix your beforefirst and afterlast functions to return "" when they didn't find anything, or check if they returned null or something
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)
fats responce thanks
do you have an example?????
i have
Function getHubNumber(sCurData)
Dim k
k = afterFirst (sCurData,"<++ ")
k = afterFirst (k,"H:")
k = beforeFirst (k,",")
If Not (isNumeric(helpString)) then
k= -1
End If
getHubNumber = cInt(k)
End Function
as a check for slots; so i dont edit this right?????
Function BeforeFirst(sIn, sFirst)
BeforeFirst = Left(sIn, InStr(1, sIn, sFirst) - 1)
End Function
Function AfterFirst(sIn,sFirst)
AfterFirst=Right(sIn,Len(sIn)-InStr(1,sIn,sFirst)-(Len(sFirst)-1))
End Function
there is my afterfirst and before first, would apreciate an example of what could be added a working one thanks 2 hubs crashed allready
do you have an example?????
i have
Function getHubNumber(sCurData)
Dim k
k = afterFirst (sCurData,"<++ ")
k = afterFirst (k,"H:")
k = beforeFirst (k,",")
If Not (isNumeric(helpString)) then
k= -1
End If
getHubNumber = cInt(k)
End Function
as a check for slots; so i dont edit this right?????
Function BeforeFirst(sIn, sFirst)
BeforeFirst = Left(sIn, InStr(1, sIn, sFirst) - 1)
End Function
Function AfterFirst(sIn,sFirst)
AfterFirst=Right(sIn,Len(sIn)-InStr(1,sIn,sFirst)-(Len(sFirst)-1))
End Function
there is my afterfirst and before first, would apreciate an example of what could be added a working one thanks 2 hubs crashed allready
ashes to ashes, dust to dust, if the dope dont get you. The acid must
-
- Posts: 506
- Joined: 2003-01-03 07:33
This might help.. changing the BeforeFist and such routines.
Code: Select all
Function BeforeFirst(sIn, sFirst) 'These are helper functions and do what their names imply
If InStr(1, sIn, sFirst) Then
BeforeFirst = Left(sIn, InStr(1, sIn, sFirst) - 1)
Else
BeforeFirst = ""
End If
End Function
Function AfterFirst(sIn, sFirst)
If InStr(1, sIn, sFirst) Then
AfterFirst = Right(sIn, Len(sIn) - InStr(1, sIn, sFirst) - (Len(sFirst) - 1))
Else
AfterFirst = ""
End If
End Function
Function AfterLast(sIn, sAfterLast)
If InStr(1, sIn, sAfterLast) Then
AfterLast = Right(sIn, Len(sIn) - InStrRev(sIn, sAfterLast) - (Len(sAfterLast) - 1))
Else
AfterLast = ""
End If
End Function
Function BeforeLast(sIn, sBeforeLast)
If InStr(1, sIn, sBeforeLast) Then
BeforeLast = Left (sIn , InStrRev(sIn, sBeforeLast) - Len(sBeforeLast))
Else
BeforeLast = ""
End If
End Function
Owner of Lurkers Lair a Phoenix Rising Hub
This might help.. changing the BeforeFist and such routines.
Code: Select all
Function BeforeFirst(sIn, sFirst) 'These are helper functions and do what their names imply
If InStr(1, sIn, sFirst) Then
BeforeFirst = Left(sIn, InStr(1, sIn, sFirst) - 1)
Else
BeforeFirst = ""
End If
End Function
Function AfterFirst(sIn, sFirst)
If InStr(1, sIn, sFirst) Then
AfterFirst = Right(sIn, Len(sIn) - InStr(1, sIn, sFirst) - (Len(sFirst) - 1))
Else
AfterFirst = ""
End If
End Function
Function AfterLast(sIn, sAfterLast)
If InStr(1, sIn, sAfterLast) Then
AfterLast = Right(sIn, Len(sIn) - InStrRev(sIn, sAfterLast) - (Len(sAfterLast) - 1))
Else
AfterLast = ""
End If
End Function
Function BeforeLast(sIn, sBeforeLast)
If InStr(1, sIn, sBeforeLast) Then
BeforeLast = Left (sIn , InStrRev(sIn, sBeforeLast) - Len(sBeforeLast))
Else
BeforeLast = ""
End If
End Function
Owner of Lurkers Lair a Phoenix Rising Hub
-
- Posts: 210
- Joined: 2003-01-23 17:24
- Location: Nevada
- Contact:
An alternative to fixing the beforefirst and afterfirst would be to start the dc++ check with a :
Then after you made all your checks, and used your unmodified afterfirst, beforefirst, etc etc -which should then have generated an error message on the way-, slap a :
(in my own code, SlotsAbuse is a sub that tries to determine if the user has a fixed/dynamic IP and accordingly bans either IP or the nick; temp or perm, depending on the type of abuse; PMs the user with the reason, etc etc. I'm sure you get the picture. If you don't want to call another sub, ban/kick them directly at that point of your sub)
The point is... if someone crashes the tag check, they're usualy a fake DC++ with half-modified tags because they don't know enough C++ to make something clean; so you end up with clients here and there that have a tag like : <++ V:0.181,M:A,U:312,S:1>
If you fix your beforefirst, afterfirst, etc functions so they don't generate an error message with the NMDC clients you described, you might very well end up letting the tag hiders/modifiers in your hub as well, since they won't generate error messages either.
Note : An error is always fatal in vbs, unless you use "On Error Resume Next". Technically, they weren't crashing your code, it's just that you had no error handling =)
Code: Select all
On Error Resume Next
Code: Select all
If Err.Number <> 0 Then [i]Call SlotsAbuse("fake","",objUser)[/i]:Exit Sub
The point is... if someone crashes the tag check, they're usualy a fake DC++ with half-modified tags because they don't know enough C++ to make something clean; so you end up with clients here and there that have a tag like : <++ V:0.181,M:A,U:312,S:1>
If you fix your beforefirst, afterfirst, etc functions so they don't generate an error message with the NMDC clients you described, you might very well end up letting the tag hiders/modifiers in your hub as well, since they won't generate error messages either.
Note : An error is always fatal in vbs, unless you use "On Error Resume Next". Technically, they weren't crashing your code, it's just that you had no error handling =)
-
- Posts: 147
- Joined: 2003-01-04 02:20
- Location: Canada http://hub-link.sf.net
- Contact:
If you take ButterflySoul's suggestions just remember, once you've eliminated known client's (NMDC, DC++, oDC) what's left isn't necessarily faker/cheaters, it's unknown clients. They might be faker/cheaters but don't assume they are in your script or you'll wind up with users who think your script is a pain in the @$$.
HaArD
HaArD
-
- Posts: 210
- Joined: 2003-01-23 17:24
- Location: Nevada
- Contact:
Maybe I explained it wrong, but my suggestion was just that if someone has a "<++" in their description -and consequently enters the DC++ hub/slots check of your code- you can start the check with On Error Resume Next and finish it by checking if no Error Code was returned. If someone generates an error once they entered the hub/slots check, they are (it's 100% sure) a tag modifier.If you take ButterflySoul's suggestions just remember, once you've eliminated known client's (NMDC, DC++, oDC) what's left isn't necessarily faker/cheaters, it's unknown clients
Clients such as NMDC, oDC or any other client will never be affected by my suggestion or wrongly kicked, since they don't have "<++" in their description, and will consequently never generate an error in the hubs/slots ratio check (since they won't enter the portion of code performing said check, if your script is written properly =).