unibotsi 7 Posted December 2, 2019 Report Share Posted December 2, 2019 While I was working on my project and running some test, suddently I get the message "conversion from string "" to type Integer is not valid" What does it mean? I think it has to do with the first loop. If I set a fixed number into the loop, instead of using a variable number coming from a UI textbox, its working. Whats wrong here? This is my code: ui open file("Textfile mit Keywords",#importedkeywords)ui save file("Save Path",#savepathset)ui text box("Position SV (Ombros = 27; Pilhar = 28)",#positionsvvarable)ui text box("Number of Loops",#numberofloops)add list to list(%keywords2check,$list from file(#importedkeywords),"Don\'t Delete","Global")loop(#numberofloops) { set(#keywords2checkfirstkwinlist,$list item(%keywords2check,0),"Global") divider remove from list(%keywords2check,0) change attribute(<outerhtml=w"<input autocapitalize=\"none\" class=\"mg-searchform-s uk-width-medium-1-3 font-14\" maxlength=\"100\" minlength=\"2\" placeholder=\"Enter keyword\" required=\"\" spellcheck=\"false\" type=\"text\" value=\"*\">">,"value",$nothing) type text(<outerhtml=w"<input autocapitalize=\"none\" class=\"mg-searchform-s uk-width-medium-1-3 font-14\" maxlength=\"100\" minlength=\"2\" placeholder=\"Enter keyword\" required=\"\" spellcheck=\"false\" type=\"text\" value=\"*\">">,#keywords2checkfirstkwinlist,"Standard") wait(5) click(<type="submit">,"Left Click","No") wait(10) divider add item to list(%keyword,$scrape attribute(<outerhtml=w"<strong class=\"mg-truncate\">*</strong>">,"innertext"),"Don\'t Delete","Global") add list to table as column(&data,0,0,%keyword) divider set(#SV,$scrape attribute($element offset(<tagname="span">,#positionsvvarable),"innertext"),"Global") set(#SV,$replace(#SV,",",""),"Global") add item to list(%SV,#SV,"Don\'t Delete","Global") add list to table as column(&data,0,1,%SV) divider add item to list(%country,$scrape attribute(<outerhtml=w"<span class=\"mg-margin-r-15\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fas\" data-icon=\"map-marker-alt\" class=\"svg-inline--fa fa-map-marker-alt fa-w-12 mg-margin-r-5\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\"viewBox=\"0 0 384 512\"><path fill=\"currentColor\" d=\"M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z\"></path></svg> *</span>">,"innertext"),"Don\'t Delete","Global") add list to table as column(&data,0,2,%country) divider add item to list(%language,$scrape attribute($element offset(<class="rw-input">,1),"innertext"),"Don\'t Delete","Global") add list to table as column(&data,0,3,%language) divider divider add item to list(%rightframenumberchek,$scrape attribute(<class="mg-results-td is-id uk-flex uk-flex-middle uk-flex-right">,"innertext"),"Don\'t Delete","Global") if($contains(%rightframenumberchek,9)) { then { } else { click(<class="mg-btn is-link is-xsmall uk-width-1-1 font-14">,"Left Click","No") } } add list to list(%LPSALL,$scrape attribute(<class=w"mg-results-td is-seo">,"innertext"),"Don\'t Delete","Global") divider set(#LPS1,$list item(%LPSALL,0),"Global") set(#LPS2,$list item(%LPSALL,1),"Global") set(#LPS3,$list item(%LPSALL,2),"Global") set(#LPS4,$list item(%LPSALL,3),"Global") set(#LPS5,$list item(%LPSALL,4),"Global") set(#LPS6,$list item(%LPSALL,5),"Global") set(#LPS7,$list item(%LPSALL,6),"Global") set(#LPS8,$list item(%LPSALL,7),"Global") set(#LPS9,$list item(%LPSALL,8),"Global") set(#LPS10,$list item(%LPSALL,9),"Global") add item to list(%LPS1,#LPS1,"Don\'t Delete","Global") add item to list(%LPS2,#LPS2,"Don\'t Delete","Global") add item to list(%LPS3,#LPS3,"Don\'t Delete","Global") add item to list(%LPS4,#LPS4,"Don\'t Delete","Global") add item to list(%LPS5,#LPS5,"Don\'t Delete","Global") add item to list(%LPS6,#LPS6,"Don\'t Delete","Global") add item to list(%LPS7,#LPS7,"Don\'t Delete","Global") add item to list(%LPS8,#LPS8,"Don\'t Delete","Global") add item to list(%LPS9,#LPS9,"Don\'t Delete","Global") add item to list(%LPS10,#LPS10,"Don\'t Delete","Global") add list to table as column(&data,0,4,%LPS1) add list to table as column(&data,0,5,%LPS2) add list to table as column(&data,0,6,%LPS3) add list to table as column(&data,0,7,%LPS4) add list to table as column(&data,0,8,%LPS5) add list to table as column(&data,0,9,%LPS6) add list to table as column(&data,0,10,%LPS7) add list to table as column(&data,0,11,%LPS8) add list to table as column(&data,0,12,%LPS9) add list to table as column(&data,0,13,%LPS10) divider divider add item to list(%SEODIFF,$scrape attribute($element offset(<class="mg-rank yellow">,0),"innertext"),"Don\'t Delete","Global") add list to table as column(&data,0,14,%SEODIFF) divider add list to list(%cpc,$scrape attribute(<outerhtml=w"<span>$*</span>">,"innertext"),"Delete","Global") set(#cpc,$list item(%cpc,0),"Global") set(#cpc,$replace(#cpc,"$",""),"Global") set(#cpc,$replace(#cpc,".",","),"Global") add item to list(%cpcfirstvalue,#cpc,"Don\'t Delete","Global") add list to table as column(&data,0,15,%cpcfirstvalue) divider add list to list(%cpc,$scrape attribute(<outerhtml=w"<span>$*</span>">,"innertext"),"Delete","Global") add list to list(%comp,$scrape attribute(<outerhtml=w"<span>*</span>">,"innertext"),"Delete","Global") set(#first_item_PPC,$list item(%comp,11),"Global") add item to list(%compfirstvalue,#first_item_PPC,"Don\'t Delete","Global") add list to table as column(&data,0,16,%compfirstvalue) divider divider save to file(#savepathset,&data) clear list(%LPSALL) clear list(%cpc) clear list(%comp)} Quote Link to post Share on other sites
UBotBuddy 331 Posted December 3, 2019 Report Share Posted December 3, 2019 When the error appears check to see if that variable has a non-numeric character in it. That could trigger that issue. Buddy Quote Link to post Share on other sites
pash 504 Posted December 3, 2019 Report Share Posted December 3, 2019 Normally, Ubot will convert String and Number automatically. But when this occurs, restart ubot. Quote Link to post Share on other sites
unibotsi 7 Posted December 3, 2019 Author Report Share Posted December 3, 2019 My input is a symple 1 as a number of course. Since 2 days I`m also having problems to run my already compiled bots (who worked before). For me it looks like I`m facing the same UI problem, described here: http://network.ubotstudio.com/forum/index.php/topic/22673-windows-10-latest-update-cause-ubot-ui-crash/ I`ve tried to perform the steps described in the video of this thread, but since my system language is german and not english, I can`t find the same websites which are showing up in that video. Any other solutions or fixes for this? Can we hope for a fix from the developer for it? Quote Link to post Share on other sites
unibotsi 7 Posted December 3, 2019 Author Report Share Posted December 3, 2019 I`ve managed to remove the latest .net update from my system, but the problem still exists. Its defenitely caused by the values numbers from the UI TEXTBOXES Does anybody else having this problem? I have it on 2 different computers (windows 7 and windows 10). It`s making me crazy because from one secound to the other everything stoped working correctly (on both computers) and I have no idea why. The only thing I found out is, that if I replace the numbers comming from the UI TEXTBOXES in the source code by real numbers, its working again.... Quote Link to post Share on other sites
UBotBuddy 331 Posted December 3, 2019 Report Share Posted December 3, 2019 Have you tried placing your variable in a $trim function? What about confirming the text length of the variable to ensure there are no invisible characters? Buddy Quote Link to post Share on other sites
HelloInsomnia 1103 Posted December 5, 2019 Report Share Posted December 5, 2019 is the variable set in the debugger? This error happens when you put an empty string in the number of cycles for loop. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.