DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: IDEA: really simple script  (Read 6,127 times)

jahrastafari

  • Participant
  • Joined in 2008
  • *
  • Posts: 3
IDEA: really simple script
« on: October 01, 2008, 10:44 PM »
using autohotkey
start script with a hotkey. output random number in a document. hit enter. wait a second. hit delete 2 times. repeat until hotkey is pressed again.

I just started trying this scripting stuff. I don't really have much yet.. just wanted to know what it would look like. thanks for any help!

jgpaiva

  • Artificial Idiocy
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • Cody Award
    • Participated in NANY Challenge Once
    • Coding Snacks
    • Portugal Inhabitant
    • Linux User
Re: IDEA: really simple script
« Reply #1 on: October 01, 2008, 11:24 PM »
something like this should do it (untested!):

Code
#persistent
flag:=true
return

f10::
if(not flag)
{
flag := true
return
}
flag:=false
loop
{
random,var,0,10
send,%random%{enter}
sleep,1000
send,{del}{del}
if (flag)
  break
}
flag:=false
return
« Last Edit: October 02, 2008, 10:05 AM by jgpaiva »

jahrastafari

  • Participant
  • Joined in 2008
  • *
  • Posts: 3
Re: IDEA: really simple script
« Reply #2 on: October 01, 2008, 11:57 PM »
doh. doesn't output any numbers. just blanks.

jahrastafari

  • Participant
  • Joined in 2008
  • *
  • Posts: 3
Re: IDEA: really simple script
« Reply #3 on: October 02, 2008, 02:25 AM »
ok i figured it out. thanks for the help.


#MaxThreadsPerHotkey, 2
return

f10::
Flag := !Flag
If !Flag
  Return
Loop 
{
  random,var,0,10
  send,%var%{enter}
  sleep,1000
  send,{del}{del}
  if !(flag)
    break
}
flag := false
return

jgpaiva

  • Artificial Idiocy
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • Cody Award
    • Participated in NANY Challenge Once
    • Coding Snacks
    • Portugal Inhabitant
    • Linux User
Re: IDEA: really simple script
« Reply #4 on: October 02, 2008, 10:06 AM »
:D glad to see it's fixed!

Original address: https://www.donationcoder.com/forum/index.php?topic=15186.0