 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
metacumbia
Joined: 02 Aug 2008 Posts: 56
|
Posted: Wed Aug 06, 2008 3:16 am Post subject: making SplashImage |
|
|
hi guys..
how can i made when i press anykey, it shows a text(splashimage) for expample: SCRIPT ON and when i press again the same key it shows SCRIPT OFF and forever...
thx, bye bye |
|
| Back to top |
|
 |
Red Hat Boy
Joined: 10 Apr 2008 Posts: 111
|
Posted: Wed Aug 06, 2008 6:05 pm Post subject: |
|
|
| Code: |
splashvar=1
SplashImage, scripton.gif, B X8 Y25
SetTimer, KillImage, -2500
!a::Msgbox hahahahaha!
!x::ExitApp
!z::
Suspend Toggle ; must appear as first line of hotkey, or this key will be suspended too!
splashvar *= -1
if (splashvar = 1)
SplashImage, scripton.gif, B X8 Y25
else
SplashImage, scriptoff.gif, B X8 Y25
SetTimer, KillImage, -2500
return
KillImage:
SplashImage, Off
return
|
_________________ I slit the sheet, the sheet I slit,
and on the slitted sheet I sit. ;~} |
|
| Back to top |
|
 |
metacumbia
Joined: 02 Aug 2008 Posts: 56
|
Posted: Wed Aug 06, 2008 7:47 pm Post subject: |
|
|
sorry Red Hat Boy, you havent understood me
look
when i press for example: F1, show on desktop a text (with splahsimage): "SCRIPT ON" during 4 seconds and then delete. And when i press again the same key (F1) it shows on desktop SCRIPT OFF during 4 sec and delete, and repeat action forever...
dont matter the position,color,font, etc |
|
| Back to top |
|
 |
Krogdor
Joined: 18 Apr 2008 Posts: 1390 Location: The Interwebs
|
Posted: Wed Aug 06, 2008 7:55 pm Post subject: |
|
|
| Code: | F1::
Count++
SplashImage, , , , % "SCRIPT " (Mod(Count,2) ? "ON!" : "OFF!")
SetTimer, DestroySplash, 4000
Return
DestroySplash:
SplashImage, Off
Return |
Like that? |
|
| Back to top |
|
 |
metacumbia
Joined: 02 Aug 2008 Posts: 56
|
Posted: Wed Aug 06, 2008 8:13 pm Post subject: |
|
|
yeaaahh brother, its works
you are the awesome fokin god
and what means all this line?:
| Code: |
% "SCRIPT " (Mod(Count,2) ? "ON!" : "OFF!"
|
i wanna understand
thx man! |
|
| Back to top |
|
 |
Dra_Gon
Joined: 25 May 2007 Posts: 373
|
Posted: Wed Aug 06, 2008 8:17 pm Post subject: |
|
|
2 items {first is related to this thread}:
1) I made a function for a small program I'm working on which basically acts like a splash message but it's nicely customizable.
To Start:
| Code: |
myVari = your ; <-- For Example
QLSplash("This would be " myVari " message!)
|
The Function:
| Code: | QLSplash(splText)
{
Global myICL
splTxtLen := StrLen(splText) * 8
picSplW := splTxtLen + 30
If splText <> Off
{
Gui, -SysMenu +0x400000 +owner -Caption +AlwaysOnTop
Gui, Margin, 0, 0
Gui, Font, s10 Bold, Verdana
Gui, Add, Picture, x0 y0 AltSubmit Icon1, %myICL%
Gui, Add, Picture, x+0 yp+0 w%picSplW% AltSubmit Icon2, %myICL%
Gui, Add, Picture, x+0 yp+0 AltSubmit Icon3, %myICL%
Gui, Add, Text, x47 y8 h15, %splText%
Gui, Show, h32
}
Else
Gui, Destroy
}
|
To End:
Explanation:
"myICL" would be your icon library, which you could make with IconCraft {www.iconempire.com} or any similar program. Here, Icon1 is the begining {duh}, Icon 2 can just be a thin slice of the middle and stretched to fit your text length {which is added on top of Icon2 and directly after Icon1}, then Icon3 is the end cap.
Icon1=
Icon2=
Icon3=
You could make the images {and the font} any way you want and have a transparent background so it follows the color of whatever theme is used on the computer.
There are a couple ways I use this in my script. One way is just a one-shot where it informs that it's Alphabetizing a particular list. And the other is in a loop where each iteration of the loop brings up my splash then ends to show me what is coming up {with a Sleep, 1000}:
| Code: | QLSplash("Starting " tmpApp "!")
RunApplic(AS_Dir%tmpApp%)
Sleep, 1000
QLSplash("Off")
|
Anyway, I thought this would be handy for ya {maybe}. Heck I'll probably just post it in the Scripts section too.
-----
2) Okay, I just noticed your sig, Red Hat Boy. This is the 2nd time today that I've seen a reference to "The Jerk" and just had to comment on it. The first one was on a dating site I'm on {okcupid} and the gal was referring to when Steve Martin was leaving the mansion and "only" needed this, that and the other.
I happened to recall that reference right off then googled up the movie and read some of the quotes from it {which is the only reason I knew that's where the sig came from}.
Anywaaay, I just wanted to comment on that.
Ciao,
Dra'Gon _________________
For a good laugh {hopefully} >> megamatts.50megs.com
My WritersCafe profile>>
http://www.writerscafe.org/writers/BlueDragonFire/ |
|
| Back to top |
|
 |
Krogdor
Joined: 18 Apr 2008 Posts: 1390 Location: The Interwebs
|
Posted: Wed Aug 06, 2008 8:23 pm Post subject: |
|
|
Well first, the % forces the parameter to be an expression.
The Mod(Count,2) divides the first parameter (count) by the second parameter (2), and returns the remainder. So, the first time, it will return 1 (1/2 has remainder 1) then the second time it will return 0 (2/2 has no remainder) then the third time it will return 1 (3/2 has remainder 1) and so on.
Then this is inside a ternary operator that will return "ON!" if Mod(Count,2) returned a true (nonzero) value, or "OFF!" if it returned a false (0) value. |
|
| Back to top |
|
 |
metacumbia
Joined: 02 Aug 2008 Posts: 56
|
Posted: Wed Aug 06, 2008 8:34 pm Post subject: |
|
|
| thanks a lot Krogdor |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|