The goal is to discover new gsm cells in a known area.
The flow executes every 5 minutes but every cid seems to be "new" from the given list in the variable.
Maybe I'm wrong with the use of variables?
thanks
Discover a new CID problem
Moderator: Martin
Discover a new CID problem
- Attachments
-
- exported_data_20140302_104355.xml
- (3.21 KiB) Downloaded 692 times
Re: Discover a new CID problem
The first condition Expression checks for cid!=global_CELL_HOME but later you assign the cid to global_NEWCELL so variable global_CELL_HOME will never change which means that the first condition will always return false.
Depending on your desired result, you could change the first condition to cid!=global_NEWCELL.
Do you want to collect all unknown cells in a list and play a sound every time a new cell is detected?
Depending on your desired result, you could change the first condition to cid!=global_NEWCELL.
Do you want to collect all unknown cells in a list and play a sound every time a new cell is detected?
Re: Discover a new CID problem
YesMartin wrote: Do you want to collect all unknown cells in a list and play a sound every time a new cell is detected?
My intention is to check if a cid is different from the list of cids contained in the variable global_cell_home and store it in global_newcell.
Re: Discover a new CID problem
You can use the scripting functions containsElement to check if a list contains an element and addElement to add new elements. The passed list has to be a real list, not just a string containing a comma separated text.
A flow to check if a new cid is detected could look like this:
-trigger Periodic Timer
-condition Phone Cell GSM
-->false: -condition Expression: containsElement(global_cells, cid)
-->false: -action Script: global_cells = addElement(global_cells, cid), action Vibrate
The condition Expression: containsElement(global_cells, cid) checks if the list global_cells contains the cell. If not, the cell is added to the list in the script action.
The script global_cells = addElement(global_cells, cid) also creates a new list if the variable global_cells should not exist yet (hence the assignment).
Starting with the next update of Automagic you can also create and edit lists manually in the global variables screen which should greatly simplify working with lists.
A flow to check if a new cid is detected could look like this:
-trigger Periodic Timer
-condition Phone Cell GSM
-->false: -condition Expression: containsElement(global_cells, cid)
-->false: -action Script: global_cells = addElement(global_cells, cid), action Vibrate
The condition Expression: containsElement(global_cells, cid) checks if the list global_cells contains the cell. If not, the cell is added to the list in the script action.
The script global_cells = addElement(global_cells, cid) also creates a new list if the variable global_cells should not exist yet (hence the assignment).
Starting with the next update of Automagic you can also create and edit lists manually in the global variables screen which should greatly simplify working with lists.
Re: Discover a new CID problem
Ok thank you, i will try!!