Why isn't this working?

icon315

Member
I was adding more to my throwerbot, but i keep running into a problem. I keep getting the error:
Code:
Begin index -1 out of bounds (Arrowbottesting.ash, line 35)
print(check ); returns
Code:
icon315 "Hi"
Here is the snippet
PHP:
void main (string sender, string message)
{  
string check;
string check2;


	if (length(message) > 5){
		check = substring(message,6);
		check2 = substring(message,0,5);
		}
	else {
	if (length(message) == 5){
	check = substring(message,0);
	check2 = substring(message,0,5);
	}
	}
	
	


	if (check2 == "smoke")
		{
			print(check);
			string check3 = substring(check, index_of(check ," \""), last_index_of(check, "\""));//LINE 35!
			check = check.replace_string(check, substring(check,6, last_index_of(check, " \"")));
				if(smoke(check,check3))//Sends the message
}
}
 
Last edited:
Which line is line 35?

If it's this one:
Code:
string check3 = substring(check, index_of(check ," \""), last_index_of(check, "\""));
It's possible that index_of(check," \"") is returning -1, possibly because it's a tab instead of a space (or something similar).
 
Code:
print(contains_text( check, '"' ));
print(check);
string check3 = substring(check, index_of(check ,'"'), last_index_of(check, '"'));
returns
Code:
false
icon315 "Hi"
Begin index -1 out of bounds (Arrowbottesting.ash, line 36)
 
That's it, just checked the saved mafia chat files and it looks like this
PHP:
<font color="#7695B4">[12:37]</font> <a href="showplayer.php?who=1491885"><b><font color="black">phil4011</font></b></a>:smoke icon315 "Hi"<br>
I plugged it in and i'm not getting that error anymore, but i need more debugging
 
Last edited:
Back
Top