Jump to content
UBot Underground

$list from file and $find regular expression not working on UBot Studio 5.0?


Recommended Posts

I have a following code that were working when on 4.2.16, but once upgrade to 5.0, not work anymore.

 

    add list to list(%lines$list from file(#pidsFile), "Delete""Local")
    set(#line$list item(%lines, 0), "Local")

 

I changed to do the following instead and it works

 

   set(#line$read file(#pidsFile), "Global")

 

I was not able to find any documentation about the change, anyone can help here?

 

Also, for the following code, what shall I do to make it work?

 

    clear list(%pids)

    add list to list(%pids$find regular expression(#line"[0-9]+"), "Delete""Local")
    set(#pid$list item(%pids, 2), "Local")

 

The content of the file is very simple - one line with a set of numbers separate by space character like the following

 

1364 2630 1988 475

 

Link to post
Share on other sites

You should revert back to ubot 4 to save a lot of time and headaches.

Ubot 5 has too many bugs and most of the users are still using ubot 4.

Link to post
Share on other sites

I have a following code that were working when on 4.2.16, but once upgrade to 5.0, not work anymore.

 

    add list to list(%lines$list from file(#pidsFile), "Delete""Local")

    set(#line$list item(%lines, 0), "Local")

 

I changed to do the following instead and it works

 

   set(#line$read file(#pidsFile), "Global")

 

I was not able to find any documentation about the change, anyone can help here?

 

Also, for the following code, what shall I do to make it work?

 

    clear list(%pids)

    add list to list(%pids$find regular expression(#line"[0-9]+"), "Delete""Local")

    set(#pid$list item(%pids, 2), "Local")

 

The content of the file is very simple - one line with a set of numbers separate by space character like the following

 

1364 2630 1988 475

 

 

Both your lists and your variables are local. Local lists and variables do not show up in the debugger in all versions (UBot 5, 4.2.20, 4.2.16 as you mentioned)

 

This is to allow you to create multiple variables and lists with the same name without causing confusion.

 

The local variables are recommended for Defined commands and threading purposes.

 

If you set your lists and variables to Global, and you set a variable for #line with a value for the find regular expression, your scripts will run without issue.

 

 

 

clear list(%pids)
set(#line, 1234, "Global")
add list to list(%pids, $find regular expression(#line, "[0-9]+"), "Delete", "Global")
set(#pid, $list item(%pids, 0), "Global")
 

 

 

Feel free to let us know at support.ubotstudio.com if you run into any more confusion. We'll do our best to clarify it for you.

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