magiccc Posted February 2, 2016 Posted February 2, 2016 (edited) Hey guys! This script was a no parameter function and it worked just like that, then i rebuilt the script, to do the function for multiple variables with a For loop. Im getting the right strings out of the array tho with the debugging MsgBoxes, and the _StringBetween works fine for the first time in the script, but when it gets to the DO part, it gives an error: update: something goes wrong when im getting the source code again in the DO part, it probably cant find the strings im referring to, but it worked when i didnt use the for loop to change the function variables (85) : ==> Subscript used on non-accessible variable.: Until $1eveskenyer[0] = 3000 Until $1eveskenyer^ ERROR Quote Local $source = _IEBodyReadHTML($asd) Local $melyikselect = _IEGetObjByName($asd,'melyik') If _IEFormElementOptionSelect ($melyikselect, $item[1]) <> 0 Then MsgBox(0,'','item is available') Local $1eveskenyer = _StringBetween($source, $item[2] ,$item[3]) If $1eveskenyer[0] <> 3000 Then MsgBox(0,'','item value is not 3000, its ' & $1eveskenyer[0] &'instead, attempting to buy') eveskenyerselect($item) Do MsgBox(0,'','Now going to buy it because price is not 3000') eveskenyerbuy() Wait() Local $source = _IEBodyReadHTML($asd) Local $1eveskenyer = _StringBetween($source, $item[2] ,$item[3]) MsgBox(0,'',$item[2] & $item[3]) Wait() Until $1eveskenyer[0] = 3000 MsgBox(0,'','Dont have to buy it again') MsgBox(0,'','putting it back at max price') eveskenyervissza($item) Else MsgBox(0,'','the item value is 3000%') EndIf Else MsgBox(0,'','the item is not on the market') EndIf Edited February 2, 2016 by magiccc
AutoBert Posted February 2, 2016 Posted February 2, 2016 That say's isn't a array, this happens when_StringBetween has nostring found => @error =1. So insert If @error then exitloop after _StringBetween, so the script not crashes. magiccc 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now