dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: iMacros coding (csv file 2 web)

  1. #1
    Join Date
    Apr 2016
    Posts
    42

    iMacros coding (csv file 2 web)

    Google Chrome:61.0.3163.100
    Os: Windows 7 x64
    iMacros: 8.4.4
    Hi,

    I am new to java-script coding and i don't have much knowledge of java-script coding in iMacros for chrome browser. i will like iMacros to search for data in the csv file on the computer before auto performing functions on the web without my interventions. I will like to make examples with betting.

    For example i create csv file on my computer and its look this way:

    ODDS STAKE
    3.56 ----------- $35
    3.17 ----------- $40
    6.5 ------------ $48
    3.67 ------------ $56
    12.57 --------- $80
    2.95 ---------- $95

    Before iMacros place bet on any game it first of all browse through the csv file first before placing the bet. if iMacros browse the csv file and found odd matching the odds on the game it automatically check the game and place the stake amount specified in the csv file and if their is no match, iMacros skip to the last code to wait for seconds. see below code:

    Code:
    TAG POS=1 TYPE=INPUT:CHECKBOX ATTR=ID:Match_Result_0_Home CONTENT=YES
    iMacros will only check the box above if the odds on this game match the odds on the csv file

    Code:
    TAG POS=1 TYPE=INPUT:NUMBER ATTR=ID:inputAmount CONTENT=$95
    The stake is automatically inputted as specified in the csv file.

    Please how can i go about this, the below is iMacros i found on iMacros site:

    Code:
    Dim message
    message = "This script demonstrates how to read data from the <address.csv> text file in the /datasource directory using"
    message = message + " iMacros DATASOURCE features. In other words, the macro reads the data directly,"
    message = message + " this script is only responsible for the loop over the data. This is similar to pressing the LOOP button,"
    message = message + "but offers more flexibility e. g. when the number of records is unknown. The script uses the macro <wsh-file-2-web.iim>." + vbCrLf + VbCrLf 
    message = message + "Tip: This script has the same function as <file-2-web-method2.vbs> but uses a different method."
    
    ' find current folder
    Dim myname, mypath
    myname = WScript.ScriptFullName
    mypath = Left(myname, InstrRev(myname, "\"))
    
    Dim iim1, i, iret
    
    set iim1= CreateObject ("imacros")
    
    iret = iim1.iimOpen("")
    if iret < 0 then MsgBox "Error during Initialization. Error code: "+cstr (iret)
    
    iret = iim1.iimDisplay("Submitting Data")
    if iret < 0 then MsgBox "Error iimDisplay. Error code: "+cstr (iret)
    
    'Note: The input file name is specified in the macro
    'You can also specify it inside the script with "iimSet"
    
    'Loop through the input file until end
    'We start at "2" to skip the first header line in the file
    i = 2
    while iret <> -1240 ' at end of input file, iMacros stops with error -1240
    'Set the current read position
    iret = iim1.iimSet("line", cstr(i))
    
    'Run the macro
    iret = iim1.iimPlay(mypath & "Macros\wsh-file-2-web.iim")
    
    'Check if user wants to stop
    if (iret = - 102) Or (iret = -101) Then
    MsgBox "Stopped by user"
    WScript.Quit(iret)
    End If 
    i = i + 1
    wend
    
    iret = iim1.iimDisplay("Done!")
    iret = iim1.iimClose
    WScript.Quit(iret)
    </nowiki>

    Here is another coding similar to the above I will want iMacros code that will automatically place bet on a bookmaker site on soccer virtual games. On the bookmaker site of the virtual games their are 38 weeks, 10 features matches on each week and 2 minutes of play.

    I will want iMacros to bet automatically on four features on the same match base on odds, for example:

    Chelsea - - - - - 1.79
    Draw - - - - - - - - 3.43
    Manu - - - - - - - - 6.5
    Home Team+Under 2.5 - - - - 7.57
    Home Team +over 2.5 - - - - 12.6

    iMacros will place bet on games from odds of 2.95 automatically. on the above example iMacros will back Manuvto win at odd of 6.5, place draw at odd of 3.43, place Home +under 2.5 odd of 7.57 and place bet on Home +over 2.5 at odd of 12.6. On each odds from 2.95 and above it should has a stake once a particular selection is made iMacros will browser the database of the stake on the selected odds. if the away team odds is below 2.95 then iMacros will place the bet below:

    Chelsea - - - - - 6.5
    Draw - - - - - - - - 3.43
    Manu - - - - - - - - 1.79
    Home Team+Under 2.5 - - - - 7.57
    Home Team +over 2.5 - - - - 12.6

    Code:
    TAB T=1
    // URL GOTO=https://www.999dice.com/?26129339
    var y = 0.00000002; // Basebet
    
    while(true)
    {
    
    function getRandomRoll(lo, hi)
    {
    return Math.floor(Math.random() * (hi - lo + 1)) + lo ;
    }
    var roll = getRandomRoll(1,10);
    if (roll >5)
    {
    var hilo = "High"; 
    }
    else
    {
    var hilo = "Low";
    } 
    
    var macro1;
    macro1 = "CODE:";
    macro1 += "SET !EXTRACT_TEST_POPUP NO" + "\n";
    macro1 += "SET !EXTRACT NULL" + "\n";
    macro1 += "TAG POS=1 TYPE=SPAN ATTR=TXT:Bet<SP>"+hilo+"&&CLASS:BetControlTitle" + "\n";
    macro1 += "SET !EXTRACT NULL" + "\n";
    macro1 += "WAIT SECONDS=3" + "\n";
    macro1 += "TAG POS=1 TYPE=SPAN ATTR=ID:LastBetInfoProfit EXTRACT=TXT" + "\n"; 
    iimPlay(macro1);
    
    var s = iimGetExtract();
    var extract = s.charAt(0);
    var j = 2;
    y = (y * j)
    var k = (y).toFixed(Cool
    
    var macro2;
    
    macro2 = "CODE:";
    macro2 += "TAG POS=1 TYPE=INPUT:TEXT ATTR=TYPE:text&&CLASS:StandardTextBox&&MAXLENGTH:15&&ID:BetSizeInput CONTENT=" +k+ "\n";
    macro2 += "WAIT SECONDS=2" + "\n";
    
    var macro3;
    macro3 = "CODE:";
    macro3 += "TAG POS=1 TYPE=INPUT:TEXT ATTR=TYPE:text&&CLASS:StandardTextBox&&MAXLENGTH:15&&ID:BetSizeInput CONTENT=0.00000002" + "\n";
    macro3 += "WAIT SECONDS=2" + "\n";
    
    if(extract == "-") {
    iimPlay(macro2);
    }
    
    if(extract == "0"){
    y = 0.00000002
    iimPlay(macro3);
    } 
    }

    Please i help so as to get the right coding on the specified functions with iMacros.
    Share on Google+

  2. #2
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    5,432
    Closed as its a duplicate of http://www.webdeveloper.com/forum/sh...sv-file-2-web)

    Please only post once in the forum. Multiple posts make it confusing and less likely to get the answer you need.
    --> JavaScript Frameworks like JQuery, Angular, Node <--
    ... and please remember to wrap code with forum BBCode tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...
    Share on Google+

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center