HELP Syntax Error: unfinished string;
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

HELP Syntax Error: unfinished string;

Started by Winss, 04 November, 2003, 21:04:30

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Winss

How can i start scripts with ptokax problem is: (Syntax Error: unfinished string;last token read: `'/**' at line 1 in file )
 
*****************************************************************

'/**
' * ShareBouncer 1.0
' * Author   : DirtyFinger
' * e-Mail   : dirtyFinger@snafu.de
' * Website   : www30.brinkster.com/dirtyfinger
' * Usage   : See the User Settings Sections down below ? Yes ? Just go there and enter stuff
'           that makes sense.
'           Once you configured the script it will check each newly connected users share for specific
'           searchstrings. If the search is unsuccessful within 20-30 seconds, the user is
'           kicked out. If EITHER search is successful, the user may stay.
' * Warning   : Passive Users don't answer to search querys, thus they ALWAYS get kicked.
'           You might want to add that to the private kickmessage in order to not piss the wrong ones off.
'           Passive Users can enter again if they are registered because registered users
'           don't get checked.
Dim sBotName
Dim dUserList
Dim oTokenizer
Dim aSearchStrings
Dim sPrivateRejectMessage,sPublicRejectMessage,sRedirectIP,sRejectMode
Sub Main ()
   '------- User Settings ---------------------------------------
   Redim aSearchStrings(1)    'When adding more searchstrings you have to increase the array first.
    aSearchStrings(0)="avi$anime"   'Put your searchstring in here (just like searching with the client. just seperate terms by $ e.g."term1$term2$term3"
    aSearchStrings(1)="mpeg$anime"   'Put your searchstring in here (just like searching with the client. just seperate terms by $ e.g."term1$term2$term3"
   sPrivateRejectMessage = "You were just kicked. DirtyFinger says you have to share something. Dunno what, because the owner forgot to customize the script."
   sPublicRejectMessage  = " was kicked by DirtyFinger because he didn't share something. Dunno what, because the owner forgot to customize the script."
   sRedirectIP = "bakaUnlimited.no-ip.no-brains.com"  'Thats where rejected ones go.
   sBotName = "ShareBouncer"   '
   sRejectMode = "kick" 'Possible modes are : "kick" "reject"
   '------- User Settings ---------------------------------------
   
   
   frmHub.registerBotName(sBotName)
   Set dUserList = CreateObject("Scripting.Dictionary")
   Set oTokenizer = new Tokenizer
   tmrScriptTimer.interval=10000     ' <- 10 seconds
   tmrScriptTimer.enabled=true    
End Sub

sub NewUserConnected (curUser) 'This event is fired when a new user logs in.
   Dim sSearch
   if not (dUserList.Exists(curUser.sName)) then
      dUserList.Add curUser.sName,2
      for each item in aSearchStrings
         curUser.SendData "$Search Hub:"+sBotName+" T?F?0?1?"+item+"|"
      next
   end if   
end sub


Sub DataArival (curUser, sCurData)
   If Left(sCurData,9) ="$GetINFO " Then Exit Sub
   If Left(sCurData,13)="$ConnectToMe " Then Exit Sub
   If Left(sCurData,16)="$RevConnectToMe " Then Exit Sub
   If Left(sCurData,8) ="$Search " Then Exit Sub
   
   if (inStr(sCurData,"$SR")) then
      oTokenizer.setTokenString(sCurData)
      if (sBotName = oTokenizer.lastToken("")) then
         'Search was requested by the bot -------------------
         sName = oTokenizer.nextToken2(" "," ")
         sSearchResult = oTokenizer.nextToken2(" ","")
         if (dUserList.Exists(sName)) then
            dUserList.Remove(sName)
         end if
         'Search was requested by the bot -------------------
      end if
   end if
End Sub

Sub tmrScriptTimer_Timer()
   for each item in dUserList.Keys
      if (dUserList(item)>0) then
         dUserList(item)= dUserList(item)-1
         'send search again in case the first search packet was lost due to , er, packet-loss
         colUsers.ItemByName(cSTR(item)).SendData "$Search Hub:"+sBotName+" T?F?0?1?"+sSearchString+"|"
      else
         colUsers.ItemByName(cSTR(item)).privateMessage cSTR(sBotName), cSTR(sPrivateRejectMessage)
         colUsers.sendChatToAll cSTR(sBotName), item + cSTR(sPublicRejectMessage)
         frmHub.doEventsForMe
      Select Case sRejectMode
         Case "kick"
            colUsers.ItemByName(cSTR(item)).kick         
         Case "redirect"
            colUsers.ItemByName(cSTR(item)).forceMove cSTR(sRedirectIP)
      End Select
         dUserList.Remove(item)         
      end if
   next   
End Sub


'--------- helper classes ------------------------------

'/**
' * StringTokenizer 1.2
' * Author : DirtyFinger
' * e-Mail : dirtyFinger@snafu.de
' * Website: www30.brinkster.com/dirtyfinger
' * Usage :
' * sub setTokenString (String)               '<-- sets the tokenString
' * function firstToken(sDelimiter)            '<-- returns the first token; sets sRestTokenString
' * function lastToken(sDelimiter)            '<-- returns the last token
' * function nextToken(sDelimiter)            '<-- returns the next token (of the sRestTokenString)
' * function nextToken2(sDelimiter1,sDelimiter2)   '<-- returns the next token between the two given delimiters
' * function hasMoreTokens(sDelimiter)         '<-- returns boolean
' * function getRestTokenString()            '<-- returns what didn't get used by firstToken/nextToken
'**/
Class Tokenizer
   private sTokenString, sRestTokenString, i, j,str
   public sub setTokenString (s)
      sTokenString = s
      sRestTokenString = s
   end sub
   public function firstToken (sDelimiter)
      i = InStr(1,sTokenString,sDelimiter)
      if (i>0) then
         firstToken = Left(sTokenString, i-1)
         sRestTokenString = Right(sTokenString, Len(sTokenString) - i - (Len(sDelimiter) - 1))
      else
         firstToken = ""
         sRestTokenString = sTokenString
      end if
   end function
   public function lastToken (sDelimiter)
      i = inStrRev(sTokenString,sDelimiter)
      lastToken = Right(sTokenString, Len(sTokenString) - i - (Len(sDelimiter) - 1))
   end function
   public function nextToken (sDelimiter)
      i = InStr(1,sRestTokenString,sDelimiter)
      if (i>0) then         
         nextToken  = Left(sRestTokenString, i-1)
         sRestTokenString = Right(sRestTokenString, Len(sRestTokenString) - i - (Len(sDelimiter) - 1))
      else
         nextToken = ""
      end if
   end function
   public function nextToken2 (sDelimiter1, sDelimiter2)
      i = InStr(1,sRestTokenString,sDelimiter1)
      j = InStr(i+1,sRestTokenString,sDelimiter2)
      str = Left (sRestTokenString, j-1)
      nextToken2 = Right(str, Len(str) - i - (Len(sDelimiter2) - 1))
      sRestTokenString = Right(sRestTokenString, Len(sRestTokenString) - j - (Len(sDelimiter2) - 1))
   end function         
   public function hasMoreTokens (sDelimiter)
      if (InStr (1,sRestTokenString,sDelimiter) >0) then
         hasMoreTokens = true
      else
         hasMoreTokens = false
      end if
   end function
   public function getRestTokenString
      getRestTokenString = sRestTokenString
   end function
end class

Function print (sMessage)
   colusers.SendChatToAll "*" , cstr(sMessage)
End Function

pHaTTy

This is not a lua script it is for DCHub >> VB
Resistance is futile!

Winss


SMF spam blocked by CleanTalk