StealthBot.net: Resolved: Dota script problem - StealthBot.net

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Resolved: Dota script problem

#1 User is offline   ixmike88 Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 23
  • Joined: April-01 10

Posted September 21, 2010 - 11:03 PM

hey this is erroring and i duno why

[05:45:52 PM] Scripting parsing error '1025' in dleague.txt: (line 3041; column 26)
[05:45:53 PM] Expected end of statement
[05:45:53 PM] Offending line: >> newName = playerName&" <"&heroName&">, "


Function AddHeroToPlayer(gameID, heroName, playerName, teamName)
Dim Team, newTeam, newName
set Team = dbconn.Execute("SELECT "&teamName&" FROM games WHERE id='"&gameID&"'")
newName = playerName&" <"&heroName&">, "
newTeam = Replace(Team(0), playerName, newName)
dbconn.Execute("UPDATE games SET "&teamName&"='"&newTeam&"' WHERE id='"&gameID&"'")
End Function

#2 User is offline   The-Black-Ninja Icon

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

Posted September 21, 2010 - 11:43 PM

When you make your next topic, choose a better topic name than simply, "Hi". I'll change it for you this time.

That line looks fine and shouldn't be causing the error, however I would question this line:
newTeam = Replace(Team(0), playerName, newName)


#3 User is offline   ixmike88 Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 23
  • Joined: April-01 10

Posted September 21, 2010 - 11:50 PM

i broke it up into

newName = playerName&" <"
newName = newName&heroName
newName = newName&">, "

and it was erroring at newName = newName&heroName if that matters

#4 User is offline   The-Black-Ninja Icon

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

Posted September 21, 2010 - 11:52 PM

Try doing this:

Function AddHeroToPlayer(gameID, heroName, playerName, teamName)

   Dim Team, newTeam, newName

   AddChat vbGreen, "gameID: " & gameID
   AddChat vbGreen, "heroName: " & heroName
   AddChat vbGreen, "playerName: " & playerName
   AddChat vbGreen, "teamName: " & teamName

   set Team = dbconn.Execute("SELECT "&teamName&" FROM games WHERE id='"&gameID&"'")
   newName = playerName&" <"&heroName&">, "
   newTeam = Replace(Team(0), playerName, newName)
   dbconn.Execute("UPDATE games SET "&teamName&"='"&newTeam&"' WHERE id='"&gameID&"'")

   Set Team = Nothing
End Function 

Post the green text.

#5 User is offline   ixmike88 Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 23
  • Joined: April-01 10

Posted September 21, 2010 - 11:53 PM

it doesnt compile

#6 User is offline   The-Black-Ninja Icon

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

Posted September 21, 2010 - 11:56 PM

Compile? You're not compiling anything, you're just overwriting your function with the one I posted, saving, reloading the script, running the command, and then posting the output from your bot.

#7 User is offline   ixmike88 Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 23
  • Joined: April-01 10

Posted September 22, 2010 - 12:02 AM

sorry, wrong choice of word

stealthbot doesn't load the plugin because of this error (which still exists)

[07:54:00 PM] Scripting parsing error '1025' in dleague.txt: (line 3048; column 25)
[07:54:00 PM] Expected end of statement
[07:54:00 PM] Offending line: >> newName = playerName&" <"&heroName&">, "

This post has been edited by ixmike88: September 22, 2010 - 12:03 AM


#8 User is offline   The-Black-Ninja Icon

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

Posted September 22, 2010 - 12:05 AM

REM out that line, then try to reload the script.
REM newName = playerName & " <" & heroName & ">, "


#9 User is offline   ixmike88 Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 23
  • Joined: April-01 10

Posted September 22, 2010 - 12:34 AM

it loads the plugin with the exception of this error as well:

		
	set usedHeroList = dbconn.Execute("SELECT HeroesUsed FROM games WHERE id='"&gameID&"'")
        randomHero = Int((MAX-MIN+1)*Rnd+MIN)
	usedHeroes = usedHeroesList(0)&Heroes(randomHero)&", "
	dbconn.Execute("UPDATE games SET HeroesUsed='"&usedHeroes&"' WHERE id='"&gameID&"'")
	RandomizeHero = Heroes(randomHero)


[08:31:17 PM] Scripting parsing error '1025' in dleague.txt: (line 4880; column 32)
[08:31:17 PM] Expected end of statement
[08:31:17 PM] Offending line: >> usedHeroes = usedHeroesList(0)&Heroes(randomHero)&", "

This post has been edited by ixmike88: September 22, 2010 - 12:36 AM


#10 User is offline   The-Black-Ninja Icon

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

Posted September 22, 2010 - 01:41 AM

Just for kicks, try this:
 usedHeroes = usedHeroesList.Fields(0)&Heroes(randomHero)&", "


#11 User is offline   Ribose Icon

  • Fire wants to be free.
  • PipPipPip
  • Group: Members
  • Posts: 282
  • Joined: July-31 09

Posted September 22, 2010 - 04:07 AM

No, the problem is your spacing.

Place a space after the & and before the variable name heroName. By having &h together, the VBScript engine interprets it as an attempt to present a hexadecimal (wiki) literal (wiki).

To avoid this and similar errors happening, it is better to place spaces around &s at all times:
newName = playerName & " <" & heroName & ">, "

~Ribose
[ Download ] [ Wiki ] [ Support ] [ Scripting ]
[ Chrome ] [ Notepad++ ] [ fedora ]
[ Homepage ] [ BNLS ♯ ]

#12 User is offline   ixmike88 Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 23
  • Joined: April-01 10

Posted September 22, 2010 - 04:37 AM

thx u own

#13 User is offline   Ribose Icon

  • Fire wants to be free.
  • PipPipPip
  • Group: Members
  • Posts: 282
  • Joined: July-31 09

Posted September 22, 2010 - 04:45 AM

I have marked this topic as resolved. If you did not receive a satisfactory response please reply and provide as much relevant information as possible.
~Ribose
[ Download ] [ Wiki ] [ Support ] [ Scripting ]
[ Chrome ] [ Notepad++ ] [ fedora ]
[ Homepage ] [ BNLS ♯ ]

Page 1 of 1
  • 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