Sign in to follow this  
Followers 0
magiccc

_StringBetween doesn't work for the second time

3 posts in this topic

#1 ·  Posted (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 by magiccc

Share this post


Link to post
Share on other sites



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.

1 person likes this

Share this post


Link to post
Share on other sites

thanks man

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0