I have macros that invites friends to FB groups, friends name is taken from CSV file, so i need write loop, than will invites all people from csv file . Here is my macros
var macro,start;
macro = "CODE:";
macro += "SET !ERRORIGNORE YES" + "\n";
macro += "SET !EXTRACT_TEST_POPUP NO" + "\n";
macro += "SET !DATASOURCE FB<SP>Groups.csv" + "\n";
macro += "SET !DATASOURCE_COLUMNS 1000" + "\n";
macro += "SET !LOOP 1" + "\n";
macro += "SET !DATASOURCE_LINE {{!LOOP}}" + "\n";
macro += "URL GOTO=" + "\n";
macro += "TAG POS=1 TYPE=I ATTR=CLASS:" + "\n";
So i think from here must starts loop
macro += "TAG POS=2 TYPE=SPAN ATTR=TXT:Invite<SP>Friends" + "\n";
macro += "SET !DATASOURCE FB<SP>Users.csv" + "\n";
macro += "SET !DATASOURCE_COLUMNS 1000" + "\n";
macro += "SET !LOOP 1" + "\n";
macro += "SET !DATASOURCE_LINE {{!LOOP}}" + "\n";
macro += "TAG POS=1 TYPE=INPUT:TEXT ATTR=CLASS:" + "\n";
macro += "TAG POS=1 TYPE=SPAN ATTR=CLASS:uiButtonText" + "\n";
iimPlay(macro)
Play with this snippet:
var macro = "CODE:";
for (i = 1; i <= 3; i++) {
macro += "SET !DATASOURCE FB<SP>Users.csv" + "\n";
macro += "SET !DATASOURCE_LINE " + i + "\n";
macro += "PROMPT {{!COL1}}" + "\n";
iimPlay(macro);
}
Hope, you can catch the idea.
Here is a way of how to define the number of rows in your csv-file:
var numRows = 0;
while (true) {
var macro = "SET !DATASOURCE FB<SP>Users.csv" + "\n";
macro += "SET !DATASOURCE_LINE " + (numRows + 1) + "\n";
if (iimPlayCode(macro) == 1)
numRows++;
else
break;
}
alert(numRows);
Related
I have finished the task of reading sensor data and store into CSV file successfully. But everytime I want to stop reading & storing sensor data, I must close the exe file. Due to the factory operation, they want to continuously run the program during a month without closing the exe file. I was required to modify the code to generate a new CSV file after a period (e.g. 1 hour). So the file name maybe: 20190516_10h0m0s, 20190516_11h0m0s, 20190516_12h0m0s...
I tried to use (struct tm) and for(;timeinfo->tm_min < 60;) to make a new CSV produced after 60'. But every loop, the item Data, time, Channel are written to the CSV again. It looks weird. But when I create the file dest and put the dest.open outside for loop, it only store correct data format without creating a new CSV as I want. Please suggest me how to make it work as expectation.
void EX_GetMultiValue(LONG i_lDriverHandle,
WORD i_wSlotID,
struct SlotInfo &i_SlotInfo)
{
char filename[20], filename2[20];
time_t rawtime;
struct tm * timeinfo;
time(&rawtime);
timeinfo = localtime(&rawtime);
timeinfo->tm_mon++; // Because the range of tm_mon is 0~11, so we need to increment it by 1
timeinfo->tm_year = timeinfo->tm_year + 1900; // Because year counted since 1900
clock_t start = clock();
sprintf(filename,
"%04d%02d%02d_%02dh%02dm%02ds.csv",
timeinfo->tm_year,
timeinfo->tm_mon,
timeinfo->tm_mday,
timeinfo->tm_hour,
timeinfo->tm_min,
timeinfo->tm_sec);
printf("\nFilename: %s", filename);
ofstream dest2;
dest2.open(filename, ios_base::app | ios_base::out);
dest2 << "Date" << "," << "Time" << "," << "milisecond" << ","
<< "Channel 0" << "," << "Channel 1" << "," << "Channel 2" << ","
<< "Channel 3" << "," << "Channel 4" << "," << "Channel 5" << ","
<< "Channel 6" << "," << "Channel 7" << "," << "Channel 8" << ","
<< "Channel 9" << "," << "Channel 10" << "," << "Channel 11" << ","
<< endl;
for (; timeinfo->tm_min < 60;)
{
ofstream dest;
dest.open(filename, ios_base::app | ios_base::out);
LONG lGetMultiValueResult = AIO_GetValues(i_lDriverHandle,
i_wSlotID,
wRawValue); //get raw value
if (ERR_SUCCESS == lGetMultiValueResult)
{
clock_t timeElapsed = clock() - start;
unsigned secElapsed = timeElapsed / CLOCKS_PER_SEC;
unsigned msElapsed = timeElapsed / CLOCKS_PER_MS;
while (msElapsed >= 1000)
msElapsed -= 1000;
while ((timeinfo->tm_sec + secElapsed) > 59)
{
timeinfo->tm_sec -= 60;
timeinfo->tm_min++;
}
while (timeinfo->tm_min > 59)
{
timeinfo->tm_min -= 60;
timeinfo->tm_hour++;
}
while (timeinfo->tm_hour > 23)
{
timeinfo->tm_hour -= 24;
timeinfo->tm_mday++;
}
dest << timeinfo->tm_year << "-" << timeinfo->tm_mon << "-"
<< timeinfo->tm_mday << "," << timeinfo->tm_hour << "h"
<< timeinfo->tm_min << "m" << timeinfo->tm_sec + secElapsed
<< "s" << ",";
dest << msElapsed << "ms" << ",";
for (iCnt = 0; iCnt < g_ChannelNum; iCnt++)
{
wRangeType = *(i_SlotInfo.wChRange + iCnt); //get range type
EX_ScaleRawValue(wRangeType,
wRawValue[iCnt],
&dScaledValue,
cUnit); //get scale value
if (strcmp(cUnit, "UN") != 0)
{
printf("Channel %d raw data is 0x%04X, scaled value is %.4f %s.\n",
iCnt,
wRawValue[iCnt],
dScaledValue,
cUnit);
dest << dScaledValue << ",";
Sleep(1);
}
else
printf("Channel %d range is unknown.\n", iCnt);
}
dest << endl;
}
else
printf("Fail to get value, error code = %d\n",
lGetMultiValueResult);
dest.close();
dest2.close();
if (dest == NULL)
{
perror("Error creating file: ");
return;
}
}
Using standard C++-facilities and Howard Hinnants date.h:
#include <chrono>
#include <string>
#include <iostream>
#include "date.h"
int main()
{
auto now{ std::chrono::system_clock::now() };
std::string filename{ date::format("%Y%m%e_%Hh%Mm%Ss.csv", now) };
std::cout << filename << '\n';
}
I don't know what you're trying to do with the rest of your code, so ...
I am trying to retrieve the values from "void readJson();" function using a getter.
void readJson() - a function I created to set values for respective variables declared in my class
I have tried to set each variable as public but it doesn't seem to work too.
void readJson()
{
...
QJsonArray json_array = json_doc.array();
/*Instantiate QJsonArray class object*/
TrainServiceDisruptionData tsds;
for (int i = 0; i < json_array.count(); ++i) {
tsds.setLine(json_array.at(i).toObject().value("line"));
}
//Train Lines
nsline nsline;
ewline ewline;
neline neline;
ccline ccline;
dtline dtline;
orline orline;
//Initializing values
int nsl = 0, ewl = 0, nel = 0, ccl = 0, dtl = 0, orl = 0;
int totalline = tsds.getLine().size();
for (int i = 0; i < totalline; ++i) {
if (tsds.getLine().at(i) == "North-South Line")
{
nsl += 1;
}
else if (tsds.getLine().at(i) == "East-West Line")
{
ewl += 1;
}
else if (tsds.getLine().at(i) == "North-East Line")
{
nel += 1;
}
else if (tsds.getLine().at(i) == "Circle Line")
{
ccl += 1;
}
else if (tsds.getLine().at(i) == "Downtown Line")
{
dtl += 1;
}
else
{
orl += 1;
}
}
nsline.setlines(nsl);
ewline.setlines(ewl);
neline.setlines(nel);
ccline.setlines(ccl);
dtline.setlines(dtl);
orline.setlines(orl);
qDebug() << "<Respective Train Breakdown Count>" << endl
<< "North-South Line: " << nsline.getlines() << endl
<< "East-West Line: " << ewline.getlines() << endl
<< "North-East Line: " << neline.getlines() << endl
<< "Circle Line: " << ccline.getlines() << endl
<< "Downtown Line: " << dtline.getlines() << endl
<< "Other Lines: " << orline.getlines() << endl
<< "Total Count: " << totalline << endl;
}
else
{
qDebug() << "file does not exists" << endl;
exit(1);
file.close();
}
}
... The codes below are where I use getter function to retrieve those values from setter function declared in readJson function...
void MainGUI::showpiechartbtnReleased()
{
nsline nsline;
ewline ewline;
neline neline;
ccline ccline;
dtline dtline;
orline orline;
int nsl = nsline.getlines();
int ewl = ewline.getlines();
int nel = neline.getlines();
int ccl = ccline.getlines();
int dtl = dtline.getlines();
int orl = orline.getlines();
//Plot pie chart data
QPieSeries *series = new QPieSeries();
series->append("North-South Line", nsl);
series->append("East-West Line", ewl);
series->append("North-East Line", nel);
series->append("Circle Line", ccl);
series->append("Downtown Line", dtl);
//series->append("Other Lines", orl);
//no idea why qt pie chart unable to display 6 data
qDebug() << "<Respective Train Breakdown Count 2>" << endl
<< "North-South Line: " << nsline.getlines() << endl
<< "East-West Line: " << ewline.getlines() << endl
<< "North-East Line: " << neline.getlines() << endl
<< "Circle Line: " << ccline.getlines() << endl
<< "Downtown Line: " << dtline.getlines() << endl
<< "Other Lines: " << orline.getlines() << endl;
QPieSlice *slice = series->slices().at(1);
slice->setExploded();
slice->setLabelVisible();
slice->setPen(QPen(Qt::darkGreen, 2));
slice->setBrush(Qt::green);
QChart *chart = new QChart();
chart->addSeries(series);
chart->setTitle("MRT Disruption Pie Chart");
//chart->legend()->hide();
QChartView *chartView = new QChartView(chart);
chartView->setRenderHint(QPainter::Antialiasing);
//Display chart
ui.verticalLayout_11->addWidget(chartView);
//Return back to line colour chart display page
ui.stackedWidget->setCurrentIndex(5);
//Remove previous chart to prevent duplicate
ui.verticalLayout_11->removeWidget(chartView);
}
After debugging, I should be getting these similar values as my output:
/*
><Respective Train Breakdown Count>
>North-South Line: 190
>East-West Line: 203
>North-East Line: 50
>Circle Line: 66
>Downtown Line: 12
>Other Lines: 53
>Total Count: 574
*/
However, I am getting these instead:
/*
><Respective Train Breakdown Count 2>
>North-South Line: 2
>East-West Line: 1514685496
>North-East Line: 1953534480
>Circle Line: 1514685496
>Downtown Line: 1953534480
>Other Lines: -1479339952
*/
Any clues? Some help will be appreciated (:
Your train line variables (like nsline nsline) are declared inside the readJsn function, so they go out of scope and disappear when the function ends.
The duplicates with the same name you declare in MainGUI are not used and have random content.
You need to declare them outside (in MainGUI, as you did), and pass them in the readJsn function to get filled. Just having variables with the same name does not associate them in any way.
What's the fastest way to create menu programmatically in C++11/Gtkmm3 without using glade? I'm looking for something easy like this:
Gtk::MenuBar* menubar = ezmenubar.create(
{"MenuBar1",
"File.New",
"File.Open",
"File.Save",
"File.Separate1:-",
"File.Coffee:check!",
"File.Cream:check!",
"File.Sugar:check",
"File.Separate2:-",
"File.Donuts:check",
"Edit.nested.item1:radio!",
"Edit.nested.item2:radio",
"Edit.nested.item3:radio",
"Edit.Copy",
"Edit.Cut",
"Radio.On:radio!",
"Radio.Off:radio",
"Radio.Random:radio",
"Help.About"}
);
add(m_box);
m_box.pack_start(*menubar, 0, 0);
There's probably a better way to do this without using xml, however, since of official way of creating gtkmm3 menus is to embedded xml string in your source code according gktmm3 manual. Here's a class to do the messy non-human friendly xml work for you. Hopefully somebody at gnome will get the idea that people hate writing xml in their c++ code and switch back to something like this:
#include <gtkmm.h>
#include <string>
#include <iostream>
#include <vector>
#include <map>
using namespace std;
class EzMenuBar
{
public:
EzMenuBar(Gtk::Window* window) : window{window}
{}
void create(initializer_list<const char*> ilist)
{
string menu_name = "noname";
vector<string> slist;
menubar = nullptr;
int i = 0;
for(string e : ilist)
{
if (i==0) menu_name = e;
else slist.push_back(e);
i++;
}
PrivateGetMenuBar(menu_name, slist);
return;
}
void add_click(const string& name, const sigc::slot<void>& slot)
{
Gtk::MenuItem* menuitem;
builder->get_widget(name, menuitem);
if (!menuitem)
{
throw std::runtime_error{string{"Error: widget does not exist:("} + name + string{")\n"}};
}
menuitem->signal_activate().connect(slot);
}
bool is_checked(const string& name) {
Gtk::CheckMenuItem* menuitem;
builder->get_widget(name, menuitem);
if (!menuitem)
{
throw std::runtime_error{string{"Error: widget does not exist:("} + name + string{")\n"}};
}
bool active = menuitem->get_active();
//delete menuitem; //memory leak? or managed by builder object?
return active;
}
Gtk::MenuBar& operator()()
{
return *menubar;
}
private:
void PrivateGetMenuBar(string menu_name, vector<string>& ilist)
{
string MenuXml = BuildMenuXml(menu_name, ilist);
try
{
builder = Gtk::Builder::create_from_string(MenuXml);
}
catch (...)
{
throw std::runtime_error{string{"Error: Menu XML Format:("} + menu_name + string{")\n"}};
}
builder->get_widget(menu_name, menubar);
if (!menubar)
{
throw std::runtime_error{string{"Error: widget does not exist:("} + menu_name + string{")\n"}};
}
return;
}
string BuildMenuXml(string menu_name, vector<string>& list)
{
tree.clear();
auto top = pair<string, vector<string>>
{
menu_name,
vector<string>{}
};
tree.insert(top);
for (string x : list)
{
string leaf_last {menu_name};
int leaf_i = 0;
vector<string> branchlist = StrSplit('.', x);
for (string& leaf_this : branchlist)
{
if (tree.count(leaf_this) == 0)
{
auto newpair = pair<string, vector<string>>
{
leaf_this,
vector<string>{}
};
tree.insert(newpair);
tree[leaf_last].push_back(leaf_this);
}
leaf_last = leaf_this;
leaf_i++;
} // foreach leaf of treeachy
} // foreach menuItem in list
string xml = BuildIt1(menu_name);
#if 1
cout << xml << "\n";
cout << "NOTES: to speed up, remove debug printing near:\n ";
cout << " " << __FILE__ << ":" << __LINE__ << "\n";
cout << "\n";
#endif
return xml;
}
string BuildIt1(string menu_name)
{
string xml;
if (!tree.count(menu_name))
return string{""};
xml += "<interface>\n";
xml += " <!-- MENU BAR: " + menu_name + " -->\n";
xml += " <object class=\"GtkMenuBar\" id=\"" + menu_name + "\">\n";
xml += " <property name=\"visible\">True</property>\n";
xml += " <property name=\"can_focus\">False</property>\n";
for (string leaf : tree[menu_name])
{
xml += BuildIt2(string{menu_name + "." + leaf}, leaf, 1);
}
xml += "\n";
xml += " </object>\n";
xml += "</interface>\n";
return xml;
}
string BuildIt2(string fullpath, string leaf, int level)
{
string xml;
if (!tree.count(leaf))
{
return string{""};
}
int count = tree[leaf].size();
vector<string> tmp = StrSplit(':', fullpath);
string fullpath_only = tmp[0];
string label = StrSplitLast('.', fullpath_only);
string attrib;
string action_id = fullpath_only;
size_t idpos = action_id.find_first_of('.');
for(int i=idpos+1; i < (int)action_id.size(); i++) {
if (action_id[i]=='.') action_id[i]='_';
}
if (tmp.size() == 2)
{
//cout << "TMP:(" << tmp[1] << ")\n";
attrib = tmp[1];
}
// GtkMenuItem
if (count == 0)
{
xml += indent(level) + "\n";
xml += indent(level) + "<!-- MENU ITEM: " + fullpath + " -->\n";
if (attrib == "-")
{
radio_group = string{};
xml += indent(level) + "<child><object class=\"GtkSeparatorMenuItem\" id=\"" + action_id + "\">\n";
xml += indent(level) + "<property name=\"visible\">True</property>\n";
xml += indent(level) + "<property name=\"can_focus\">False</property>\n";
}
else if (attrib == "check" || attrib == "check!")
{
radio_group = string{};
xml += indent(level) + "<child><object class=\"GtkCheckMenuItem\" id=\"" + action_id + "\">\n";
xml += indent(level) + "<property name=\"visible\">True</property>\n";
xml += indent(level) + "<property name=\"can_focus\">False</property>\n";
xml += indent(level) + "<property name=\"label\" translatable=\"yes\">" + label + "</property>\n";
xml += indent(level) + "<property name=\"use_underline\">True</property>\n";
if (attrib == "check!")
{
xml += indent(level) + "<property name=\"active\">True</property>\n";
// Not using xml signals. How to connect glade signals from c++??
xml += indent(level) + "<signal name=\"toggled\" handler=\"" + action_id + "\" swapped=\"no\"/>\n";
}
}
else if (attrib == "radio" || attrib == "radio!")
{
bool group_start = false;
if (radio_group.empty())
{
group_start = true;
radio_group = action_id; //fullpath_only;
}
xml += indent(level) + "<child><object class=\"GtkRadioMenuItem\" id=\"" + action_id + "\">\n";
xml += indent(level) + "<property name=\"visible\">True</property>\n";
xml += indent(level) + "<property name=\"can_focus\">False</property>\n";
xml += indent(level) + "<property name=\"label\" translatable=\"yes\">" + label + "</property>\n";
xml += indent(level) + "<property name=\"use_underline\">True</property>\n";
if (attrib == "radio!")
{
xml += indent(level) + "<property name=\"active\">True</property>\n";
}
xml += indent(level) + "<property name=\"draw_as_radio\">True</property>\n";
xml += indent(level) + "<property name=\"group\">" + radio_group + "</property>\n";
if (group_start) {
xml += indent(level) + "<signal name=\"group-changed\" handler=\"" + action_id + "\" swapped=\"no\"/>\n";
}
}
else
{
radio_group = string{};
xml += indent(level) + "<child><object class=\"GtkMenuItem\" id=\"" + action_id + "\">\n";
xml += indent(level) + "<property name=\"visible\">True</property>\n";
xml += indent(level) + "<property name=\"can_focus\">False</property>\n";
xml += indent(level) + "<property name=\"label\" translatable=\"yes\">" + label + "</property>\n";
xml += indent(level) + "<property name=\"use_underline\">True</property>\n";
xml += indent(level) + "<signal name=\"activate\" handler=\"" + action_id + "\" swapped=\"no\"/>\n";
}
}
// GtkMenu
else
{
xml += indent(level) + "\n";
xml += indent(level) + "<!-- SUB-MENU: " + fullpath + " -->\n";
xml += indent(level) + "<child><object class=\"GtkMenuItem\" id=\"" + action_id + "\">\n";
xml += indent(level) + "<property name=\"visible\">True</property>\n";
xml += indent(level) + "<property name=\"can_focus\">False</property>\n";
xml += indent(level) + "<property name=\"label\" translatable=\"yes\">" + label + "</property>\n";
xml += indent(level) + "<child type=\"submenu\"><object class=\"GtkMenu\" id=\"" + fullpath_only + ".submenu" + "\">\n";
xml += indent(level) + "<property name=\"visible\">True</property>\n";
xml += indent(level) + "<property name=\"can_focus\">False</property>\n";
}
level++;
for (string child : tree[leaf])
{
xml += BuildIt2(string{fullpath + string{"."} + child}, child, level);
}
level--;
if (count == 0)
{
xml += indent(level) + "</object></child>\n";
}
else
{
xml += indent(level) + "</object></child>\n";
xml += indent(level) + "</object></child>\n";
}
return xml;
}
string indent(int level)
{
string INDENT;
for(int i=0; i < level; i++) INDENT += " ";
return INDENT;
//return string{level, ' '};
}
static vector<string> StrSplit(char delimit, string& line)
{
vector<string> split;
size_t pos_last = -1;
while(1)
{
size_t pos_this = line.find_first_of(delimit, pos_last+1);
if (pos_this == string::npos)
{
split.push_back(line.substr(pos_last+1));
break;
}
split.push_back(line.substr(pos_last+1, pos_this-pos_last-1));
pos_last = pos_this;
}
return split;
}
static string StrSplitLast(char delimit, string& line)
{
size_t pos = line.find_last_of(delimit);
if (pos == string::npos)
{
return line;
}
return line.substr(pos+1);
}
private:
Gtk::MenuBar* menubar;
Gtk::Window* window;
string radio_group;
Glib::RefPtr<Gtk::Builder> builder;
map<string, vector<string>> tree;
string MenuXml;
};
class WnMain : public Gtk::Window
{
public:
void callback() {
cout << "HELLO\n";
}
WnMain()
{
ezmenubar.create({
"MenuBar1",
"File.New",
"File.Open",
"File.Save",
"File.Separate1:-",
"File.Coffee:check!",
"File.Cream:check!",
"File.Sugar:check",
"File.Separate2:-",
"File.Donuts:check",
"Edit.nested.item1:radio!",
"Edit.nested.item2:radio",
"Edit.nested.item3:radio",
"Edit.Copy",
"Edit.Cut",
"Radio.On:radio!",
"Radio.Off:radio",
"Radio.Random:radio",
"Help.About"
});
ezmenubar.add_click("MenuBar1.File_New", sigc::mem_fun(*this, &WnMain::callback));
ezmenubar.add_click("MenuBar1.File_Open",
[&]() {cout << "FILE.Open\n";}
);
ezmenubar.add_click("MenuBar1.Radio_On",
[&]() {
// NOTE: signal_active is buggy for RadioMenuItem under windows,
// ie. not always triggering...70% of time? i'll leave that one to gnome.org
// to cleanup...(1/9/2017)
if (ezmenubar.is_checked("MenuBar1.Radio_On")) {
cout << "MenuBar1.Radio_On: checked\n";
}
else if (ezmenubar.is_checked("MenuBar1.Radio_Off")) {
cout << "MenuBar1.Radio_Off: checked\n";
}
else if (ezmenubar.is_checked("MenuBar1.Radio_Random")) {
cout << "MenuBar1.Radio_Random: checked\n";
}
else {
cout << "MenuBar1.Radio: nothing selected\n";
}
});
ezmenubar.add_click("MenuBar1.File_Coffee",
[&]() {
if (ezmenubar.is_checked("MenuBar1.File_Coffee")) {
cout << "File.Coffee: checked\n";
}
else {
cout << "File.Coffee: not-checked\n";
}
});
add(m_box);
m_box.pack_start(ezmenubar());
show_all_children();
}
private:
Gtk::Box m_box {Gtk::ORIENTATION_VERTICAL};
EzMenuBar ezmenubar {this};
string radio_group;
};
int main(int argc, char** argv)
{
try
{
auto app = Gtk::Application::create(argc, argv, "wmoore");
WnMain wnmain;
return app->run(wnmain);
}
catch (std::runtime_error e)
{
cout << "EXCEPTION:" << e.what() << "\n";
}
}
Your question is a bit misleading. If you would like to build it manually I would like to refer you to the app_and_win_menus example on the gtkmm homepage: https://git.gnome.org/browse/gtkmm-documentation/tree/examples/book/application/app_and_win_menus.
Please find below an excerpt on how to build the menu of the application during the startup.
void ExampleApplication::on_startup(){
//Call the base class's implementation:
Gtk::Application::on_startup();
auto app_menu = Gio::Menu::create();
app_menu->append("_Something", "app.something");
app_menu->append("_Quit", "app.quit");
set_app_menu(app_menu);
// [...]
}
The full example will give you a good overview on how to create the menu with the Gio::Menu class functions. Please find more information on the Gui::Menu Class Reference page at https://developer.gnome.org/glibmm/stable/classGio_1_1Menu.html
Script not going to URL'S from CSV file, what i'm doing wrong? Script not giving any errors.
var macro;
macro = "CODE:";
macro += "SET !EXTRACT_TEST_POPUP NO" + "\n";
macro += "SET !DATASOURCE Facebook_Groups.csv" + "\n";
macro += "SET !DATASOURCE_COLUMNS 1000" + "\n";
macro += "SET !LOOP 1" + "\n";
macro += "SET !DATASOURCE_LINE {{!LOOP}}" + "\n";
macro += "URL GOTO='{{!COL1}}'" + "\n";
macro += "TAG POS=1 TYPE=I ATTR=CLASS:'img sp_sn-egcmZHgp sx_3e65cc'" + "\n";
var macro;
macro = "CODE:";
macro += "SET !EXTRACT_TEST_POPUP NO" + "\n";
macro += "SET !DATASOURCE Facebook_Groups.csv" + "\n";
macro += "SET !DATASOURCE_COLUMNS 1000" + "\n";
macro += "SET !LOOP 1" + "\n";
macro += "SET !DATASOURCE_LINE {{!LOOP}}" + "\n";
macro += "URL GOTO='{{!COL1}}'" + "\n";
macro += "TAG POS=1 TYPE=I ATTR=CLASS:img<sp>sp_sn-egcmZHgp<sp>sx_3e65cc" + "\n";
iimPlay(macro)
I'm new to Imacros, I know how to use it very well but I'm new to coding so It's my first script.
I'm gettig this error while starting it.
SyntaxError: unknown command: VAR, line: 1 (Error code: -910)
Heere is the codes.
var macroStart;
macroStart ="CODE:";
macroStart +="SET !ERRORIGNORE YES" + "\n";
macroStart +="SET !TIMEOUT_TAG 1" + ="\n";
macroStart +="SET !TIMEOUT_STEP 1" + "\n";
macroStart +="SET !TIMEOUT_PAGE 8" + "\n";
macroStart +="SET !REPLAYSPEED FAST" + "\n";
macroStart +="SET !TIMEOUT_MACRO 8" + "\n";
macroStart +="TAB T=1" + "\n";
macroStart +="WAIT SECONDS=1" + "\n";
macroStart +="TAG POST=1 TYPE=A ATTR=TXT:LIKE" + "\n";
macroStart +="TAB T=2" + "\n";
macroStart += " FRAME F=0" + "\n";
macroStart += "TAG POST=1 TYPE=LABEL ATTR=ID;timelineHeadlineLikeButton" + "\n";
macroStart += "TAB T=2" + "\n";
macroStart += "WAIT SECONDS=1" + "\n";
macroStart += "TAB T=1"
macroStart += "TAB CLOSEALLOTHERS" + "n"\
macroStart +="WAIT SECONDS=1" + "\n";
macroStart += "TAG POS=1 TYPE=A ATTR=TXT:Like" + "\n";
macroStart += "TAB T-2" + "\n";
macroStart += "FRAME F=0" + "\n";
macroStart += "TAG POST=1 TYPE=LABEL ATTR=ID;timelineHeadlineLikeButton" + "\n";
macroStart += "TAB T=1" + "\n";
macroStart += "TAB CLOSEALLOTHERS" + "n"\
macroStart += "WAIT SECONDS=1" + "n"\
macroStart += "VERSION BUILD=8300326 RECORDER=FX" + "\n"
macroStart +="TAB T=1" + "/n";
macroStart +="URL GOTO=https://www.facebook.com/mohamed.nasser.37017794" + "\n";
macroStart +="WAIT SECONDS=1" + "\n";
macroStart +="TAG POS=1 TYPE=INPUT:SUBMIT ATTR=VALUE:Hacker" + "\n";
macroStart +="WAIT SECONDS=1" + "\n";
macroStart +="TAB T=1" + "/n";
var 1=0;
var n=prompt ("Facebook Crack PASSWORD by SCORPION HACKER.",5000)
for (i=1; i <= n; i++)
(
iimPlay("CODE:"+"URL GOTO=https://www.facebook.com/")
iimPlay(macroStart,25)
iimDisplay("Current loop is: "+i")
iimDisplay("New Page")
)
Please help me I'm trying to start it.
Maybe you pasted the JS code inside .iim file. Make sure the file extension is .js