StealthBot.net: Resolved: Left() - Error - StealthBot.net

Jump to content

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

Resolved: Left() - Error

#1 User is offline   Rafal Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 15
  • Joined: November-09 09

Posted September 08, 2011 - 05:34 PM

Hi i wrote a small script to invite user automatically to clan checking coditions: 45%+ total stats, no peon

Script("Name") = "Invite to Clan"
Script("Author") = "Rafal"
Script("Major") = 1
Script("Minor") = 0
Script("Description") = "Invites some user to clan checking some conditions."

Sub Event_UserJoins(Username, Flags, Message, Ping, Product, Level, OriginalStatstring, Banned)

	Picture = Left(Message, InStr(Message, "icon,")-2)
	Picture = Mid(Picture, InStr(Picture, ",")+1)
	Picture = Mid(Picture, InStr(Picture, ",")+2)
	
	data = CStr(scINet.OpenURL("http://classic.battle.net/war3/ladder/w3xp-player-profile.aspx?Gateway=Northrend&PlayerName=" & Username))
	
	UserIsInClan = 0
	If InStr(data, "<span class=""rankingData"">Clan Name:<br><b></b></span>")>0 Then 
		UserIsInClan = 1
	End If
	
	Percent = Mid(data, InStr(data, "Total:")+6+5+36+15+36+15+36+15)
    Percent = Mid(Percent, InStr(Percent, """>")+2)
    Percent = Left(Percent, InStr(Percent, "</td")-3)
		
	If (UserIsInClan = 0 AND Percent >= 45.00 AND NOT(Picture = "peon")) Then
		AddQ "/w " & Username & " An invitation has been send to you, the conditions to join are: 1 icon, 45%+. An Inactivity of 7 days lead to a kick."
		Command BotVars.Username, "/invite " & Username, True
	End If	
End Sub


i got a error at this line: Picture = Left(Message, InStr(Message, "icon,")-2)

Scripting runtime error '5' in Invite to Clan: (line 9; column 1)
Ungültiger Prozeduraufruf oder ungültiges Argument: 'Left' (Google Translater: Invalid procedure call or invalid argument: 'Left')
Offending line: >>

could someone help me?

This post has been edited by Rafal: September 08, 2011 - 05:36 PM


#2 User is offline   Jack Icon

  • Might actually be named Chris
  • PipPipPip
  • Group: Members
  • Posts: 193
  • Joined: August-01 09

Posted September 08, 2011 - 08:55 PM

You need to make sure there is a "icon, " in Message before trying to parse it out.
Posted Imageass

#3 User is offline   Rafal Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 15
  • Joined: November-09 09

Posted September 09, 2011 - 10:44 AM

thank you for the tip i got it.

#4 User is offline   The-Black-Ninja Icon

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

Posted October 11, 2011 - 02:06 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.

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