Jump to content

_ArraySearch Returns true or false


Recommended Posts

From the Help file:

Return Value

Success: The index that $vValue was found at

Failure: -1, sets @error:

1 - $avArray is not an array

2 - $avArray is not a 1 dimensional array

4 - $iStart is greater than $iEnd

6 - $vValue was not found in array

7 - $avArray has too many dimensions

(3, 5 - Deprecated error codes)

Link to comment
Share on other sites

From the Help file:

Return Value

Success: The index that $vValue was found at

Failure: -1, sets @error:

1 - $avArray is not an array

2 - $avArray is not a 1 dimensional array

4 - $iStart is greater than $iEnd

6 - $vValue was not found in array

7 - $avArray has too many dimensions

(3, 5 - Deprecated error codes)

So do you know why this returns something everytime? I'm searching for 25% enhanced effect and not 20 btw.

$array1 = _StringBetween(_INetGetSource ("http://forums.d2jsp.org/user.php?c=3&i=564064&p=283765?"), "<fieldset><legend>Equipment ( 2 / 8 )</legend>", "</fieldset>")
;_ArrayDisplay($array1,"Items:")

sleep(2000)
Dim $sSearch[2] = ["+30 Strength", "20% Enhanced Effect"]
    For $i2 = 0 To UBound($sSearch) -1
        $iIndex = _ArraySearch($array1, $sSearch[$i2], 0, 0, 0, 1)
        if $iIndex <> "" then mousemove(0,0)
        next
        Exit
Link to comment
Share on other sites

n/m I think I got it

Adroitful, could you think about adding a comment or adding a new post in future rather than delete the original question because when the original question or problem is removed it can make the whole thread nonsense?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

"<fieldset><legend>Equipment ( 2 / 8 )</legend>" not found.

#include <Array.au3>
#include <INet.au3>
#include <String.au3>

$Source = _INetGetSource("http://forums.d2jsp.org/user.php?c=3&i=564064&p=283765?")
MsgBox(0, '', $Source)
$array1 = _StringBetween($Source, "<fieldset><legend>Equipment ( 2 / 8 )</legend>", "</fieldset>")
ConsoleWrite('Error: ' & @error & @CR)
;_ArrayDisplay($array1,"Items:")
Exit

#cs

Sleep(2000)
Dim $sSearch[2] = ["+30 Strength", "20% Enhanced Effect"]
For $i2 = 0 To UBound($sSearch) - 1
    $iIndex = _ArraySearch($array1, $sSearch[$i2], 0, 0, 0, 1)
    If $iIndex <> "" Then
        MouseMove(0, 0)
    EndIf
Next

#ce
Link to comment
Share on other sites

Adroitful, could you think about adding a comment or adding a new post in future rather than delete the original question because when the original question or problem is removed it can make the whole thread nonsense?

Sure, sorry about that! I got this whole mess figured out thanks!

Edit: For some reason, every time I go to post my question, I think of how to fix it after spending a while messing with something lol

Edited by adroitful
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...