Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 15:54

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Counter with pictures?

Discussion on Counter with pictures? within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
newbot's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 372
Received Thanks: 113
Counter with pictures?

Hey guys,

I have an Idea for a game and I need your help. I want to do a Counter, wich counts the kills of the bosses.
An exampe:
After you killed the Boss A, you click on his pictures or when you killed the Boss B, you click on his picture.

And after weeks I can see how often I killed these Bosses.

Can someone help me with that? Is it possible with AutoIt or do I need another programm?
newbot is offline  
Old 07/17/2013, 16:26   #2
 
butter123's Avatar
 
elite*gold: 95
Join Date: May 2011
Posts: 982
Received Thanks: 189
wie ich hier schon geschrieben habe
verbesser da evtl noch die guiabfrage.

dann baust du noch ein, dass er beim beenden in eine datei schreibt, was wie oft angeklickt wurde und am anfang wird aus der datei gelesen und die zählervariable entsprechend gesetzt.
butter123 is offline  
Thanks
1 User
Old 07/17/2013, 22:35   #3
 
CantShutMyMouth's Avatar
 
elite*gold: 0
Join Date: Apr 2012
Posts: 379
Received Thanks: 163
If you just want to save the number of bosses killed, use IniRead and IniWrite
CantShutMyMouth is offline  
Thanks
1 User
Old 07/18/2013, 03:03   #4
 
newbot's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 372
Received Thanks: 113
Hab so viel Ahnung von AutoIT, wie vom Ballet!

Was muss ich nun machen? Also Bilder müssen es nicht sein, hauptsache man klickt auf den Namen und man hat die Kill-Anzahl neben an stehen.
newbot is offline  
Old 07/18/2013, 09:41   #5

 
xcyancali's Avatar
 
elite*gold: 155
The Black Market: 1057/0/0
Join Date: Jul 2012
Posts: 24,491
Received Thanks: 2,568
Soll auch nach dem Neustart des Programmes die Kill anzahl vorhanden sein?
Wenn dies der Fall ist , dann schreibe den Wert in eine .ini Datei oder benutze Filewrite / Fileread.

Wenn die Kills an den Boss nur in der Zeit sein sollen , in dem das Programm offen ist, dann lege eine Variable an & wenn dann der Boss getötet ist durch ein Klicken , dann erhöst du den Counter um 1.
Mache eben ein Beispiel:
Du hast ja wenn du eine Gui erstellt hast , eine schleife wo du die Case befehle reinschreiben kannst.
da machste dann einfach:

Case $Bild;deine Bild variable einfügen
$kill_counter += 1 ;counter wird um 1 erhöht.

guictrlsetdata($deinLabel,$kill_counter)
Am anfang des Script machst du denn noch die Deklaration der Variable hin.
$kill_counter = 0

Ich habe das jetzt am Handy geschrieben. Ich werde nach wenn du möchtest ein Beispiel mit einem Vollständigen Code hier reinstellen.
xcyancali is offline  
Thanks
1 User
Old 07/18/2013, 17:10   #6
 
elite*gold: 5
Join Date: Mar 2008
Posts: 460
Received Thanks: 436
AutoIt Code (Kurz runtergeschrieben, funktioniert aber. Sauber ist es evtl. nicht, da wie gesagt nur 5 min Zeit genommen)
Code:
Opt("GuiOnEventMode", 1)

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 164, 100, 192, 150)
$Button1 = GUICtrlCreateButton("Button1", 8, 8, 75, 33, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("Label1", 96, 25, 36, 26)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit", $Form1)
GuiCtrlSetOnEvent($Button1, "_Hochzaehlen")

Global $IrgendeinerCount = 0

_OptionsLoad()
GUICtrlSetData($Label1, "Counter: " & $IrgendeinerCount)

While 1
	Sleep(100)
WEnd

Func _Exit()
	Exit
EndFunc

Func _Hochzaehlen()
	_OptionsLoad()
	$IrgendeinerCount+=1
	_OptionsSave()
	GUICtrlSetData($Label1, "Counter: " & $IrgendeinerCount)
EndFunc


Func _OptionsLoad()
	$IrgendeinerCount = IniRead(@ScriptDir & "/Options.ini" , "Boss", "Irgendeiner", "Default")
EndFunc   ;==>_LoadOptions

Func _OptionsSave()
	IniWrite(@ScriptDir & "/Options.ini" , "Boss", "Irgendeiner", $IrgendeinerCount)
EndFunc   ;==>_SaveOptions
INI-Datei (Options.ini):
Code:
[Boss]
Irgendeiner=30
SwarN is offline  
Thanks
1 User
Old 07/20/2013, 03:43   #7
 
newbot's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 372
Received Thanks: 113
Oh man,
Ihr gibt euch Mühe und verstehe kaum was!

Also ich will, dass man nach dem Neustart immer noch die Werte hat. Sagen wir mal ich habe 8 "Bosse/Dungeons". Wo schreibe ich das denn hin? Oder wo füge ich neue hin zu?
newbot is offline  
Old 07/20/2013, 08:55   #8
 
FacePalmMan's Avatar
 
elite*gold: 0
Join Date: Jan 2013
Posts: 426
Received Thanks: 129
Iniwrite beispiel:
Code:
IniWrite("Dateiname.txt","Section","key","Wert")
wie die datei Dateiname.txt dann aussieht:
Code:
[Section]
key=Wert
Wie es funktioniert: Iniwrite schreibt in einer vorgegebenen section in einen bestimmten key rein (neben dem =).

Iniread Beispiel:

Datei-Inhalt:
Code:
[Section]
key=Wert
Iniread:
Code:
IniRead("Dateiname.txt","Section","key","Rückgabewert falls datei/key nicht vorhanden")
Return Value: Wert
Wenn die datei ,die section oder der key nicht existiert wird "Rückgabewert falls datei/key nicht vorhanden" zurückgegeben.

Wie es funktioniert: iniread liest in der vorgegebenen section den vorgegebenen key aus und gibt den inhalt der key zurück.
FacePalmMan is offline  
Thanks
1 User
Old 07/20/2013, 14:05   #9
 
Shadow992's Avatar
 
elite*gold: 77
Join Date: May 2008
Posts: 5,430
Received Thanks: 5,876
Zuerst das:


Dann das:


Dann das:
Shadow992 is offline  
Thanks
1 User
Old 09/08/2013, 01:13   #10
 
newbot's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 372
Received Thanks: 113
Hey Leute,

ich habe mir das mal angeguckt, aber verstehe nicht so wirklich, wie ich das mit der IniRead und IniWrite machen soll.
newbot is offline  
Old 09/08/2013, 12:05   #11
 
lolkop's Avatar
 
elite*gold: 280
Join Date: May 2007
Posts: 2,818
Received Thanks: 3,483
Quote:
Originally Posted by newbot View Post
Hey Leute,

ich habe mir das mal angeguckt, aber verstehe nicht so wirklich, wie ich das mit der IniRead und IniWrite machen soll.
die inifunktionen sind hierfür nicht notwendig... normale filefunktionen erleichtern das ganze noch etwas...

beispiel mit buttons statt bildern:
Code:
Dim $btn[20], $wert=0, $kills = StringRegExp(FileRead("kill.txt"), "<(\d+)>", 3)
GUICreate("GUI", 310, 130, Default, Default, 0x10C80000)

For $x=0 To 4
	For $y=0 To 3
		If UBound($kills)>=UBound($btn) Then $wert = $kills[$x*4+$y]
		$btn[$x*4+$y] = GUICtrlCreateButton($wert, 10+$x*60, 10+$y*30, 50, 20)
	Next
Next

Do
	$msg = GUIGetMsg()
	For $i=0 To UBound($btn)-1
		If $msg=$btn[$i] Then GUICtrlSetData($btn[$i], GUICtrlRead($btn[$i])+1)
	Next
Until $msg=-3

$file = FileOpen("kill.txt", 2)
For $i=0 To UBound($btn)-1
	FileWrite($file, '<'&GUICtrlRead($btn[$i])&'>')
Next
FileClose($file)
lolkop is offline  
Reply


Similar Threads Similar Threads
~~GFX~Shop Kleiner Signatur Laden /Special Pictures/Famous Pictures~~
08/12/2011 - elite*gold Trading - 5 Replies
Hier ein Einblick in meine Werke Diese Signaturen verkaufe ich pro Stück 2 Elite Gold... Leider beherrsche ich noch nicht die Kunst des Schriftzugs darum sind keine Namen drauf Aber dennoch meiner Ansicht nach schöne Bilder ;) Weitere Motive könnte ich machen Ihr braucht mir nur zu sagen was auf dem Bild sein muss...
WTS LVL 50 ACC with Pictures
08/10/2011 - Need for Speed World - 1 Replies
Imageshack - nfsw027k.jpg Cars i have got R8 4.2 FSI Quattro MG GTR E46 Nissan S15
[Pictures] AIO v3
08/24/2009 - 12Sky2 - 36 Replies
http://img36.imageshack.us/img36/2918/pic1v3.pnght tp://img30.imageshack.us/img30/9791/pic2v3.png Everything is the same, just re-coded it different. "See Player Levels", "AR (Autorevive)", and "Exit on Death" are only for people with level 2 private status. Status is assigned by me and I'm very strict. Also, blade3000 and I decided that the public has been too careless and irresponsible to handle these programs. Level 1 status will be able to download the program and use everything...



All times are GMT +2. The time now is 15:54.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.