Author Topic: Problem with my digispark  (Read 1825 times)

ElStefaano

  • Newbie
  • *
  • Posts: 4
Problem with my digispark
« on: April 30, 2019, 09:11:48 am »
I'm trying some siple things with my digispark.
but i got stuck on this.

mshta vbscript:Execute("msgbox ""EXAMPLE TEXT"":close"

But arduino gives me this error :
exit status 1
expected ')' before 'msgbox'

 DigiKeyboard.println("mshta vbscript:Execute("msgbox ""EXAMPLE TEXT"":close"");

Why wont it type the text i want.





ElStefaano

  • Newbie
  • *
  • Posts: 4
Re: Problem with my digispark
« Reply #1 on: May 02, 2019, 11:48:13 am »
Is there noone that can help me with this??

granzeier

  • Jr. Member
  • **
  • Posts: 73
Re: Problem with my digispark
« Reply #2 on: May 03, 2019, 02:15:54 am »
You are not really giving us enough information to make a guess. What is the code that you have running on the Digispark? What is the rest (initialization...) of the VBscript? Have you gotten any response from the Digispark? Have you gotten any error messages? Does any other program work on the Digispark (i.e. have you gotten it to run the blink program, or anything else)?
Sorry, but from your description, it looks like you tried running VBscript directly on the Digispark - and, as far as I know, that won't work.

ElStefaano

  • Newbie
  • *
  • Posts: 4
Re: Problem with my digispark
« Reply #3 on: May 04, 2019, 08:38:54 am »
I only showed part of the code as i thought you would understand.

im trying to use the digispark as a keyboard to annoy a frend at work. :)

Code: [Select]
#include "DigiKeyboard.h"
void setup() {
}

void loop() {
  DigiKeyboard.sendKeyStroke(0);
  DigiKeyboard.delay(500);
  DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
  DigiKeyboard.delay(500);
  DigiKeyboard.print("mshta vbscript:Execute("msgbox ""ANNOYING MESSAGEBOX"":close")");
  DigiKeyboard.sendKeyStroke(KEY_ENTER)
  for (;;) {
  }
}

But arduino gives me this error :
exit status 1
expected ')' before 'msgbox'

So the question is why dont it do what i want.



I have also tryed to make it type 1 letter at time.

like this :
#include "DigiKeyboard.h"
void setup() {
}

void loop() {
  DigiKeyboard.sendKeyStroke(0);
  DigiKeyboard.delay(500);
  DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
  DigiKeyboard.delay(500);
DigiKeyboard.print("m");
  DigiKeyboard.delay(500);
DigiKeyboard.print("s");
  DigiKeyboard.delay(500);
DigiKeyboard.print("h");
  DigiKeyboard.delay(500);
DigiKeyboard.print("a");

and so on.....
but i still get the same error message.

The "script works if you type it in the run meny , so nothing wrong there.

/edit..
yes the digispark works with "blink" and simple "hello world"
i'm not running the script on the digispark , im trying to get it to type it in the run meny.
but i guess it dont like that there is a "(" in the text i'm trying to make it type.



« Last Edit: May 05, 2019, 11:29:37 am by ElStefaano »

granzeier

  • Jr. Member
  • **
  • Posts: 73
Re: Problem with my digispark
« Reply #4 on: May 04, 2019, 06:05:29 pm »
Sorry, but I haven't used VBScript - most of my scripting now-a-days is in bash (Linux.)

I'm guessing, but it seems like the errors may be from the line:

  DigiKeyboard.print("mshta vbscript:Execute("msgbox ""ANNOYING MESSAGEBOX"":close")");

although the line under it looks like it has been messed up with smileys.
I'm guessing that if you want to have the Arduino code make the Digispark send a quote mark ("), you may need to send the keycode, rather than have the quote marks in the DigiKeyboard.print string. I think that all these quote marks may be messing up the compiler. It may have troubles keeping track of the parenthesis - i.e. which is inside the print string, and which is not.

When you use the second, character-by-character, method, where do you get the error? That may give you a clue as to which parenthesis is causing the troubles.

ElStefaano

  • Newbie
  • *
  • Posts: 4
Re: Problem with my digispark
« Reply #5 on: May 05, 2019, 11:28:18 am »
The error comes at the ( just before "msgbox

i get the same error when i make it type 1 letter then wait 1 sec and type another , and another and so on.