Jump to content
UBot Underground

$Set List Position by item?


Recommended Posts

Is there a way to $set list position by for instance a #variable or an item in the list?

 

So if you have a list containing the following:

 

apples

pears

oranges

banana

peaches

 

So for instance "oranges".

Then i want to $set list position => oranges instead of $set list position => "3"

 

Reason is that the list is "dynamic" so i want to start from a list but i do not know the content of the list, but i do know the itemname, which is anywhere in the list (can be from line 0 to 100000000000000).

 

Also, is there a way to set an end position?

Same thing, but now i want to set a list position that it stops the current task.

Kinda "$set end position", so as soon as that item (or #variable) is reached the script stops or move on to the next task.

Link to post
Share on other sites

There you go:

 

add to list(fruits);
Set $pos = 0;
while(not($listitem($pos)=="oranges"))
{
 inc($pos);
}
Set $listpostion = $pos;
{
Do something.....
.....
.....
}

Link to post
Share on other sites

There you go:

 

add to list(fruits);
Set $pos = 0;
while(not($listitem($pos)=="oranges"))
{
 inc($pos);
}
Set $listpostion = $pos;
{
Do something.....
.....
.....
}

 

Thanks Praney, will check this tomorrow on my bot. :)

Link to post
Share on other sites

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...