Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with my first code
#1
Hello All.
Im really new when It comes to LibreAutomate and coding.

Im trying to get some automation on my computer.

And the solution I have come up with Is to have different Scripts ( Maybe not optimal )
So I have 1 script that runs everytime my computer starts, Sends a message on Telegram and closes Telegram, Then It runs script 2 that starts another program and when Its started It takes a screenshot, Goes to telegram and paste the picture and sends a message.

But sometimes the script aint workking and I really dont understand why.

How could I make the program to wait until Telegram have loaded up instead of

wait.ms

Im trying to understand classes and everything but for me at the moment its really hard to understand Sad

Does anyone know some good tutorials that maybne can help me?


The code looks like this.
 
Code:
Copy      Help
/*/ role exeProgram; optimize true; outputPath %folders.Workspace%\exe\1 Start PC Send TG2; bit32 true; /*/ //.
script.setup(trayIcon: true, sleepExit: true);

        // Start TG at PC start send Msg

var w = wnd.find(1, "Program Manager", "Progman");
var e = w.Elm["LISTITEM", "Telegram", "id=1", EFFlags.HiddenToo].Find(5);
e.SendKeys("Enter");

var w2 = wnd.find(1, "Telegram", "Qt51513QWindowIcon");
IFImage[] image = {
    @"image:",
};

var im = uiimage.find(0, w2, image);
im.MouseClick();

wait.ms(300);


//    COMPUTER START    //
keys.sendt("PC Start");

wait.ms(300);

keys.send("Enter");

wait.ms(500);

var w3 = wnd.find(1, "PC Start", "Qt51513QWindowIcon");
var e2 = w3.Elm["BUTTON", "Stäng", flags: EFFlags.HiddenToo].Find(0);
e2.MouseClick();

wait.ms(500);


//..

// START SCRIPT 2 Start CT Tab Send TG


script.run("2 Start CT Tab Send TG");


Forum Jump:


Users browsing this thread: 1 Guest(s)