Search found 1992 matches

by Rohwedder
05 Jul 2019, 13:03
Forum: Skripte und Funktionen
Topic: Geräusch eines Geiger-Müller-Zählers
Replies: 0
Views: 133

Geräusch eines Geiger-Müller-Zählers

Hallo, ich wollte das Geräusch eines Geiger-Müller-Zählers simulieren. Gegeben: die mittlere Zeit zwischen zwei Zerfällen und die gleichverteilte Zufallszahl (0-1) von Autohotkey. Gesucht: Berechnung der zufälligen Zeit (0-unendlich) zwischen zwei Zerfällen. Habe das gesamte Netz nach einer Formel d...
by Rohwedder
05 Jul 2019, 08:26
Forum: Ask For Help
Topic: Passing variables between scripts Topic is solved
Replies: 16
Views: 697

Re: Passing variables between scripts Topic is solved

Hallo,
(.) is not an operator but just the numerical value between -0 and 0
Try:

Code: Select all

MsgBox,% -0<(.) And (.)<0
by Rohwedder
05 Jul 2019, 02:20
Forum: Gaming
Topic: Auto queue villagers
Replies: 3
Views: 270

Re: Auto queue villagers

Hallo,
Instead of copying from the artificial intelligence files of your game,
you should use your own intelligence and read the manual!
If you want Autohotkey to write "train villagers", try:

Code: Select all

Numpad4::
Send, train villagers
Return
By the way, you don't need to compile!
by Rohwedder
05 Jul 2019, 01:54
Forum: Gaming
Topic: 4 digit macro
Replies: 1
Views: 110

Re: 4 digit macro

Hallo,
try:

Code: Select all

$e:: ;start with E
Number = 0
Loop, 10000
{
	Send, e{Up}{Enter}
	Sleep, 50
	Number := Format("{:04}", Number)
	Send, %Number%{Enter}
	Number++
	Sleep, 50
}
*Esc::ExitApp ;stop with Escape
by Rohwedder
05 Jul 2019, 01:22
Forum: Ask For Help
Topic: Settimer
Replies: 1
Views: 83

Re: Settimer

Hallo, to examine a script, just add tooltips. Try: f9:: SetTimer, te, 200 ToolTip,% A_TickCount " Line: " A_LineNumber return f9 up:: SetTimer, te, off ToolTip return te: send {1 Down} send {1 Up} return and you see that the F9 hotkey is repeated continuously. Better: f9:: SetTimer, te, 200 KeyWait...
by Rohwedder
04 Jul 2019, 02:31
Forum: Ask For Help
Topic: Slightly Modified Left Mouse Toggle
Replies: 3
Views: 149

Re: Slightly Modified Left Mouse Toggle

Hallo, perhaps: ~LButton::hold = ; switch off hold flag !+u up:: ; TOGGLE MOUSE if hold:= !hold ; toggle hold flag Click down ; presses the left button else Click up ; releases the left button return or shorter: ~LButton::hold = ; switch off hold flag !+u up::Click,% (hold:=!hold)?"down":"up" ; TOGG...
by Rohwedder
03 Jul 2019, 06:23
Forum: Ask For Help
Topic: Arrays, Small letters and Capital Letters
Replies: 4
Views: 217

Re: Arrays, Small letters and Capital Letters

Hallo, try with Strings: #SingleInstance, Force #NoEnv pw = tibaksoncrmdefghjlpquvwxyz Alphabet = abcdefghijklmnopqrstuvwxyz TestData = Lucky is my NAME! >.<" Hello! &*/()[email protected]#$456789`~{}[]|":?><,.`% ;`protected % Loop, parse, TestData { IF q := InStr(Alphabet, A_LoopField, True) ;CaseSensitive :=...
by Rohwedder
03 Jul 2019, 03:02
Forum: Ich brauche Hilfe
Topic: Eine beliebig lange Zeichenkette (wegen defekter Taste) durch einen einzelnen Buchstaben ersetzen Topic is solved
Replies: 4
Views: 307

Re: Eine beliebig lange Zeichenkette (wegen defekter Taste) durch einen einzelnen Buchstaben ersetzen Topic is solved

Hallo,
obiges berücksichtigt nicht die Feststelltaste (CapsLock) und deaktiviert den Explorer-Aufruf über Win+e.
Versuch mal:

Code: Select all

*e::
	Send, {Blind}e
	KeyWait, e
Return
by Rohwedder
02 Jul 2019, 08:10
Forum: Ask For Help
Topic: Incorrect spelling
Replies: 1
Views: 183

Re: Incorrect spelling

Hallo,
try:

Code: Select all

:*:geode::goede
by Rohwedder
02 Jul 2019, 04:17
Forum: Ask For Help
Topic: ControlSend with holding key down
Replies: 2
Views: 307

Re: ControlSend with holding key down

Hallo,
try:

Code: Select all

SetKeyDelay,, 50 ;default Delay, PressDuration = 50ms 
ControlSend,, +3, ahk_class Notepad
by Rohwedder
02 Jul 2019, 02:16
Forum: Ich brauche Hilfe
Topic: per RegExReplace Hexadezimalpunkte ersetzen
Replies: 3
Views: 280

Re: per RegExReplace Hexadezimalpunkte ersetzen

Hallo, ich habe es nun mit einem länglichen Zweizeiler gelöst. Bin aber noch auf der Suche nach einer eleganteren Methode. q:: Exp := "2 * 0x3.243F6A8885A" ;Rechenaufgabe While, RegExMatch(Exp, "(0x[[:xdigit:]]*\.)([[:xdigit:]]*)", M) Exp := StrReplace(Exp,M,"(" StrReplace(M,".") "/0x1" RegexReplace...
by Rohwedder
01 Jul 2019, 09:27
Forum: Ich brauche Hilfe
Topic: per RegExReplace Hexadezimalpunkte ersetzen
Replies: 3
Views: 280

Re: per RegExReplace Hexadezimalpunkte ersetzen

Verboten? Das meinen vielleicht Programmierer! Aber, deren Mathematik ist nur etwas höher als die der Kaufleute welche keine negativen Zahlen kennen und stattdessen von Soll und Haben reden. Autohotkeys Format() kennt immerhin die Typenzeichen a und A: Vorzeichenfähiger hexadezimaler Floating-Point-...
by Rohwedder
01 Jul 2019, 05:14
Forum: Ich brauche Hilfe
Topic: per RegExReplace Hexadezimalpunkte ersetzen
Replies: 3
Views: 280

per RegExReplace Hexadezimalpunkte ersetzen

Hallo, Javascript/COM (wie auch Autohotkey) versteht offenbar keine rationalen Zahlen mit Hexadezimalpunkt. Deswegen wird in dieser Rechenaufgabe: q:: Exp := "2 * 0x3.243F6A8885A" ;Rechenaufgabe ; bitte dieses RegexReplace verallgemeinern: Exp := RegexReplace(Exp,"0x3.243F6A8885A","(0x3243F6A8885A/0...
by Rohwedder
01 Jul 2019, 00:45
Forum: Ask For Help
Topic: Script Help
Replies: 1
Views: 208

Re: Script Help

Hallo,
tested in Notepad, works!
by Rohwedder
30 Jun 2019, 02:48
Forum: Ask For Help
Topic: on / off key help Topic is solved
Replies: 2
Views: 196

Re: on / off key help Topic is solved

Hallo,
try:

Code: Select all

Loop
{
	loop, 26000
	{
		Send, {F down}
		Send, {F Up}
		Sleep, 385
	}
	loop, 1
	{
		Send, {4 down}
		Sleep, 750
		Send, {4 up}
	}
}
return
= Up::
Send, {F Up}{4 Up}
Pause,,1
Return
by Rohwedder
29 Jun 2019, 15:04
Forum: Ask For Help
Topic: Solved:Need simple example,real time calculating and output the result
Replies: 40
Views: 1678

Re: Solved:Need simple example,real time calculating and output the result

Hallo, I know what you did. Your code makes "percentage automatic calculation". That means: You're typing : 80 + 2 % = then the calculator automatically solves the equation : 80 + 80 * 2% = 81.6 But the equation : 80 + 2% simply means: 80 + 2/100 = 80 + 0.02 = 80.02 There is a difference between an ...
by Rohwedder
29 Jun 2019, 11:54
Forum: Ask For Help
Topic: Solved:Need simple example,real time calculating and output the result
Replies: 40
Views: 1678

Re: Solved:Need simple example,real time calculating and output the result

I didn't think there was any interest left, so I corrected the code of vsub only for myself. This code seems to be correct now, but (sorry) your new suggestion makes mistakes at No1, 2, 5 and 6: MsgBox, % "No1" calc_Percent( "125.2%+0.5%" ) MsgBox, % "No2" calc_Percent( "((5+15)*4)/20%+20+3%" ) MsgB...
by Rohwedder
29 Jun 2019, 02:22
Forum: Ask For Help
Topic: playing with array
Replies: 4
Views: 264

Re: playing with array

Hallo,
why not just a String?:

Code: Select all

String := "abcdefghijklmnopqrstuvwxyz"
Inputbox, RandLetters, RandLetters, Input RandLetters
Loop, Parse, RandLetters
	String := StrReplace(String, A_LoopField)
String := RandLetters String
MsgBox,% String
by Rohwedder
28 Jun 2019, 02:59
Forum: Ask For Help
Topic: How do I bring the focus back to the address bar on Chrome.
Replies: 1
Views: 103

Re: How do I bring the focus back to the address bar on Chrome.

Hallo,
try:

Code: Select all

^p::
Run, chrome.exe
WinWaitActive, New Tab - Google Chrome, , 5
WinMaximize
send, ^l%urlA%{Enter}
sleep, 2000
send, ^l%urlB%{Enter}
sleep, 2000
send, ^l%urlC%{Enter}
sleep, 2000
send, ^l%urlD%{Enter}
sleep, 20001
send, ^l%urlE%{Enter}
sleep, 2000
send, ^l%urlF%{Enter}
sleep, 2000
return

Go to advanced search