Jump to content
UBot Underground

Script Error: Input string was not in correct format.


Recommended Posts

Hi Guys,

 

Strange problem here, I have this code working perfectly fine in 1 bot which has no defines, I try and copy and paste the code or put it in a define and it throws up an error, even in a brand new bot.

 

I am getting:

Script Error: Input string was not in correct format.

Script > set > $rand

 

And the code which basically gets a random URL and its matching Keyword from a CSV.

 

clear table(&Targets)
create table from file("{$special folder("Application")}\\data\\targets.csv"&Targets)
set(#RandomRow$rand(0, $eval($subtract($table total rows(&Targets), 1))), "Global")
set(#Keyword$table cell(&Targets#RandomRow, 0), "Global")
set(#URL$table cell(&Targets#RandomRow, 1), "Global")

 

Any ideas?

 

 

Link to post
Share on other sites

Seems to work just fine for me. :)

 

test()
define test {
    clear table(&Targets)
    create table from file("{$special folder("Application")}\\data\\targets.csv"&Targets)
    set(#RandomRow$rand(0, $eval($subtract($table total rows(&Targets), 1))), "Global")
    set(#Keyword$table cell(&Targets#RandomRow, 0), "Global")
    set(#URL$table cell(&Targets#RandomRow, 1), "Global")
}

 

I just put random letters in the csv file

Link to post
Share on other sites

You are experiencing problems because of the $eval function. When you load a page that doesn't use javascript $eval will return an empty string "", which I think is the case on your side.

 

I've simulated the conditions here and I get the same error as you: http://screencast.com/t/abFdnqAer6

 

However, to fix the code just remove $eval and this should solve your problem (you dont need to use $eval since $substract function will always return an integer).

 

.

Link to post
Share on other sites
  • 7 months later...
  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...