Hallo!
Ich hab dieses Skript:
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include<guiedit.au3>
#include<inet.au3>
#include<string.au3>
#include<array.au3>
#include<comboconstants.au3>
Const $pi = 3.14159
Const $e = 2.71828
Local $button[28]
Local $umrechner[11]
Local $formelsammlung[6]
Global $nachkommastellen = 2
global $read = IniReadSection(@ScriptDir & "\data.ini", "Währungskurse")
Local $speicher[5]
HotKeySet("^!a", "a")
HotKeySet("^!b", "b")
HotKeySet("^!c", "c")
HotKeySet("^!d", "d")
For $i = 1 To 4
$speicher[$i] = IniRead(@ScriptDir & "\data.ini", "Speicher", $i, "")
Next
$source = _INetGetSource("http://www.waehrungskurs.de/content/kurse/index.php")
$string = _StringBetween($source, '<td class="col2">', '</td>')
$string2 = _StringBetween($source, '<td class="col3">', '</td>')
For $i = 1 To UBound($string2) - 1
StringReplace(StringReplace($string2[$i], ".", ""), ",", ".")
IniWrite(@ScriptDir & "\data.ini", "Währungskurse", $string[$i], $string2[$i])
Next
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]#Region ### START Koda GUI section ### Form=f:\autoit-projekte\rechner.kxf
$Form1_1 = GUICreate("Taschenrechner", 325, 610, 526, 122)
$MenuItem1 = GUICtrlCreateMenu("Funktionen")
$MenuItem2 = GUICtrlCreateMenuItem("Rechner", $MenuItem1)
$MenuItem3 = GUICtrlCreateMenuItem("Graphenzeichner", $MenuItem1)
$MenuItem5 = GUICtrlCreateMenuItem("Währungsrechner", $MenuItem1)
$MenuItem4 = GUICtrlCreateMenu("&Optionen")
$MenuItem6 = GUICtrlCreateMenuItem("Formelsammlung", $MenuItem1)
$button[1] = GUICtrlCreateButton("1", 40, 289, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$button[2] = GUICtrlCreateButton("2", 90, 289, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$button[3] = GUICtrlCreateButton("3", 140, 289, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$button[4] = GUICtrlCreateButton("4", 40, 339, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$button[5] = GUICtrlCreateButton("5", 90, 339, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$button[6] = GUICtrlCreateButton("6", 140, 339, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$button[7] = GUICtrlCreateButton("7", 40, 389, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$button[8] = GUICtrlCreateButton("8", 90, 389, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$button[9] = GUICtrlCreateButton("9", 139, 389, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$button[10] = GUICtrlCreateButton(".", 40, 440, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$button[11] = GUICtrlCreateButton("0", 90, 440, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$button[12] = GUICtrlCreateButton("=", 140, 440, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
$Edit1 = GUICtrlCreateEdit("", 8, 29, 305, 237, BitOR($ES_CENTER, $es_readonly, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_HSCROLL, $WS_VSCROLL), BitOR($WS_EX_CLIENTEDGE, $WS_EX_STATICEDGE))
GUICtrlSetData(-1, "")
$button[13] = GUICtrlCreateButton("+", 191, 289, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xD8E4F8)
$button[14] = GUICtrlCreateButton("-", 191, 339, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xD8E4F8)
$button[15] = GUICtrlCreateButton("*", 191, 389, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xD8E4F8)
$button[16] = GUICtrlCreateButton("/", 191, 440, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xD8E4F8)
$Input1 = GUICtrlCreateInput("", 8, 266, 264, 21)
$button[17] = GUICtrlCreateButton("^", 40, 491, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xD8E4F8)
$button[18] = GUICtrlCreateButton("Wurzel", 90, 491, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xD8E4F8)
$button[19] = GUICtrlCreateButton("Pi", 140, 491, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xD8E4F8)
$button[20] = GUICtrlCreateButton("e", 191, 490, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xD8E4F8)
$button[21] = GUICtrlCreateButton("Bildschirm löschen", 216, 0, 108, 28, $WS_GROUP)
$button[22] = GUICtrlCreateButton("A", 40, 540, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
$button[23] = GUICtrlCreateButton("B", 90, 540, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
$button[24] = GUICtrlCreateButton("C", 140, 540, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
$button[25] = GUICtrlCreateButton("D", 190, 540, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_GROUP))
$button[26] = GUICtrlCreateButton("Alle Speicher leeren", 0, 0, 108, 28, $WS_GROUP)
$button[27] = GUICtrlCreateButton("1 Speicher leeren", 108, 0, 108, 28, $WS_GROUP)
$umrechner[8] = GUICtrlCreateGroup("Umrechnung von Euro in ...", 7, 16, 195, 94)
$umrechner[1] = GUICtrlCreateCombo("", 20, 36, 173, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
For $i = 1 To $read[0][0]
GUICtrlSetData(-1, $read[$i][0])
Next
guictrlsetstate(-1, $gui_hide)
$Umrechner[2] = GUICtrlCreateInput("Betrag", 20, 56, 173, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$umrechner[3] = GUICtrlCreateInput("Ergebnis", 20, 76, 173, 21)
guictrlsetstate(-1, $gui_hide)
guictrlsetstate(-1, $gui_disable)
$umrechner[4] = GUICtrlCreateGroup("Umrechnung von Euro in ...", 7, 112, 195, 94)
$umrechner[5] = GUICtrlCreateCombo("", 20, 132, 173, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
For $i = 1 To $read[0][0]
GUICtrlSetData(-1, $read[$i][0])
Next
$umrechner[6] = GUICtrlCreateInput("Betrag", 20, 152, 173, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$umrechner[7] = GUICtrlCreateInput("Ergebnis", 20, 172, 173, 21)
guictrlsetstate(-1, $gui_disable)
$umrechner[9]= guictrlcreatebutton( "Umrechnen!", 202, 150, 108, 28)
$umrechner[10]= guictrlcreatebutton("Umrechnen!", 202, 55, 108, 28)
for $i= 1 to 10
guictrlsetstate($umrechner[$i],$gui_hide)
next
$formelsammlung[1] = GUICtrlCreateList("", 23, 9, 250, 250)
GUICtrlSetData(-1, "Ableitungen der Trigonometrie|Flächeninhalt Kreis|Kettenregel|Mantelfläche Kegel|Mantelfläche Zylinder|Mitternachtsformel|Umfang Kreis|Oberfläche Zylinder|Oberfläche Kegel|Volumen Kegel|Volumen Kugel|Oberfläche Kugel|")
GUICtrlSetState(-1, $gui_hide)
$formelsammlung[2] = GUICtrlCreateButton("Formel anschauen", 24, 250, 131, 27, $WS_GROUP)
GUICtrlSetState(-1, $gui_hide)
$formelsammlung[3]= guictrlcreatelabel("Brauchst du noch Hilfe? Dann such doch nach Mathevideos",24, 300, 250, 40)
guictrlsetstate(-1, $gui_hide)
$formelsammlung[4]= guictrlcreateinput("Suchwort", 24, 340, 173, 21)
guictrlsetstate(-1, $gui_hide)
$formelsammlung[5]= guictrlcreatebutton("Suche", 200, 338, 120, 25)
guictrlsetstate(-1, $gui_hide)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $MenuItem3
For $i = 1 To 27
GUICtrlSetState($button[$i], $gui_show)
Next
for $i= 1 to 5
GUICtrlSetState($formelsammlung[$i], $gui_hide)
next
for $i=1 to 10
guictrlsetstate($umrechner[$i], $gui_hide)
next
GUICtrlSetState($Edit1, $gui_hide)
GUICtrlSetData($button[12], "Zeichnen")
GUICtrlSetFont($button[12],
Case $MenuItem2
For $i = 1 To 27
GUICtrlSetState($button[$i], $gui_show)
Next
for $i = 1 to 10
guictrlsetstate($umrechner[$i], $gui_hide)
next
for $i= 1 to 5
GUICtrlSetState($formelsammlung[$i], $gui_hide)
next
GUICtrlSetState($Edit1, $gui_show)
guictrlsetstate($input1, $gui_show)
GUICtrlSetData($button[12], "=")
GUICtrlSetFont($button[12], 20)
Case $MenuItem5
For $i = 1 To 27
GUICtrlSetState($button[$i], $gui_hide)
GUICtrlSetState($Edit1, $gui_hide)
GUICtrlSetState($Input1, $gui_hide)
Next
for $i=1 to 5
GUICtrlSetState($formelsammlung[$i], $gui_hide)
next
For $i = 1 To 10
GUICtrlSetState($umrechner[$i], $gui_show)
Next
Case $MenuItem6
For $i = 1 To 5
GUICtrlSetState($formelsammlung[$i], $gui_show)
Next
for $i= 1 to 27
GUICtrlSetState($button[$i], $gui_hide)
GUICtrlSetState($Edit1, $gui_hide)
GUICtrlSetState($Input1, $gui_hide)
Next
for $i= 1 to 10
guictrlsetstate($umrechner[$i], $gui_hide)
next
Case $button[1]
_GUICtrlEdit_AppendText($Input1, "1")
Case $button[2]
_GUICtrlEdit_AppendText($Input1, "2")
Case $button[3]
_GUICtrlEdit_AppendText($Input1, "3")
Case $button[4]
_GUICtrlEdit_AppendText($Input1, "4")
Case $button[5]
_GUICtrlEdit_AppendText($Input1, "5")
Case $button[6]
_GUICtrlEdit_AppendText($Input1, "6")
Case $button[7]
_GUICtrlEdit_AppendText($Input1, "7")
Case $button[8]
_GUICtrlEdit_AppendText($Input1, "8")
Case $button[9]
_GUICtrlEdit_AppendText($Input1, "9")
Case $button[11]
_GUICtrlEdit_AppendText($Input1, "0")
Case $button[12]
_GUICtrlEdit_AppendText($Edit1, GUICtrlRead($Input1) & @CRLF & "=" & Execute(GUICtrlRead($Input1)) & @CRLF & @CRLF)
$gerundet = Round($Input1, $nachkommastellen)
GUICtrlSetData($gerundet, "")
$ans= $gerundet
Case $button[13]
If guictrlread($input1)= "" then
guictrlsetdata($input1, $ans&"+")
else
_GUICtrlEdit_AppendText($Input1, "+")
endif
Case $button[14]
If guictrlread($input1)= "" then
guictrlsetdata($input1, $ans&"-")
else
_GUICtrlEdit_AppendText($Input1, "-")
endif
Case $button[15]
If guictrlread($input1)= "" then
guictrlsetdata($input1, $ans&"*")
else
_GUICtrlEdit_AppendText($Input1, "*")
endif
Case $button[16]
If guictrlread($input1)= "" then
guictrlsetdata($input1, $ans&"/")
else
_GUICtrlEdit_AppendText($Input1, "/")
endif
Case $button[10]
_GUICtrlEdit_AppendText($Input1, ".")
Case $button[17]
_GUICtrlEdit_AppendText($Input1, "^")
Case $button[18]
_GUICtrlEdit_AppendText($Input1, "sqrt(x)")
Case $button[19]
_GUICtrlEdit_AppendText($Input1, $pi)
Case $button[20]
_GUICtrlEdit_AppendText($Input1, $e)
Case $button[21]
GUICtrlSetData($Edit1, "")
Case $button[22]
_GUICtrlEdit_AppendText($Input1, $speicher[1])
Case $button[23]
_GUICtrlEdit_AppendText($Input1, $speicher[2])
Case $button[24]
_GUICtrlEdit_AppendText($Input1, $speicher[3])
Case $button[25]
_GUICtrlEdit_AppendText($Input1, $speicher[4])
case $button[26]
For $i= 1 to 4
$speicher[$i]=""
IniWrite(@ScriptDir & "\data.ini", "Speicher", $i, "")
next
case $button[27]
$speicherleeren= Inputbox("1 Speicher löschen", "Welcher Speicher soll gelöscht werden", "A")
switch $speicherleeren
case "A"
$speicher[1]=""
IniWrite(@ScriptDir & "\data.ini", "Speicher", "1", "")
case "B"
$speicher[2]=""
IniWrite(@ScriptDir & "\data.ini", "Speicher", "2", "")
case "C"
$speicher[3]=""
IniWrite(@ScriptDir & "\data.ini", "Speicher", "3", "")
case "D"
$speicher[4]=""
IniWrite(@ScriptDir & "\data.ini", "Speicher", "4", "")
endswitch
For $i = 1 To 20
GUICtrlSetState($button[$i], $gui_hide)
GUICtrlSetState($Edit1, $gui_hide)
GUICtrlSetState($Input1, $gui_hide)
Next
GUICtrlSetState($formelsammlung[1], $gui_show)
case $formelsammlung[5]
If Guictrlread($formelsammlung[4])= "Suchwort" or Guictrlread($formelsammlung[4])="" then
Msgbox(16, "Fehler", "Gib ein gültiges Suchwort ein")
else
Shellexecute("http://oberprima.com/mathenachhilfe/suche/?cx=008647203485790777655%3Agg_fg77guts&cof=FORID%3A9&ie=UTF-8&q="&stringreplace(guictrlread($formelsammlung[4])," ", "+")&"e&sa=Suche&siteurl=oberprima.com%2Fmathenachhilfe%2F#922")
endif
Case $formelsammlung[2]
Switch GUICtrlRead($formelsammlung[1])
Case "Ableitungen der Trigonometrie"
MsgBox(0, "Ableitungen der Trigonometrie", "f(x)= sin(x) | f'(x)= cos(x)" & @CRLF & "f(x)= cos(x)|f'(x)=-sin(x)" & @CRLF & "f(x)=-sin(x) |f'(x)= -cos(x)" & @CRLF & "f(x)=-cos(x) | f'(x)= sin(x)")
Case "Flächeninhalt Kreis"
Msgbox(0, "Flächeninhaltkreis", "A= pi*r^2" & @Crlf & "A= (pi/4)*d²)")
case "Kettenregel"
Msgbox(0, "Kettenregel", "f(x)= g(h(x))" & @Crlf & "f'(x)= h'(x) * g'(h(x))" & @Crlf & @crlf & "Innere Ableitung mal äußere Ableitung.")
case "Mantelfläche Zylinder"
Msgbox(0, "Mantelfläche Zylinder", "M= U*h")
case "Mantelfläche Kegel"
Msgbox(0, "Mantelfläche Kegel", "M= r*s*pi")
case "Mitternachtsformel"
Msgbox(0, "Mitternachtsformel", "x1, x2= (-b+-Sqrt(b²-4ac))/2a)")
case "Oberfläche Kegel"
Msgbox(0, "Oberfläche Kegel", "A= r*pi(r+s)")
case "Oberfläche Kugel"
Msgbox(0, "Oberfläche Kugel", "4*pi*r^2")
case "Oberfläche Zylinder"
Msgbox(0, "Oberfläche Zylinder", "A=2G+M" & @Crlf & "A= 2*(pi*r²) + 2*pi*r*h)")
case "Umfang Kreis"
Msgbox(0, "Umfang Kreis", "U= pi*d")
case "Volumen Kegel"
Msgbox(0, "Volumen Kegel", "1/3G*h")
case "Volumen Kugel"
msgbox(0, "Volumen Kugel","(4/3)pi*r³")
EndSwitch
case $umrechner[10]
GUICtrlSetData($umrechner[3], Number(StringReplace(GUICtrlRead($umrechner[1]), ",", ".")) * Number(IniRead(@ScriptDir & "\data.ini", "Währungskurse", GUICtrlRead($umrechner[2]), "")))
case $umrechner[9]
GUICtrlSetData($umrechner[7], Number(StringReplace(GUICtrlRead($umrechner[6]), ",", ".")) / Number(IniRead(@ScriptDir & "\data.ini", "Währungskurse", GUICtrlRead($umrechner[5]), "")))
EndSwitch
WEnd
; Speicherfunktionen
Func a()
$markiert = ControlCommand("", "", "Edit1", "Getselected")
IniWrite(@ScriptDir & "\data.ini", "Speicher", "1", $markiert)
$speicher[1] = $markiert
EndFunc ;==>a
Func b()
$markiert = ControlCommand("", "", "Edit1", "Getselected")
IniWrite(@ScriptDir & "\data.ini", "Speicher", "2", $markiert)
$speicher[2] = $markiert
EndFunc ;==>b
Func c()
$markiert = ControlCommand("", "", "Edit1", "Getselected")
IniWrite(@ScriptDir & "\data.ini", "Speicher", "3", $markiert)
$speicher[3] = $markiert
EndFunc ;==>c
Func d()
$markiert = ControlCommand("", "", "Edit1", "Getselected")
IniWrite(@ScriptDir & "\data.ini", "Speicher", "4", $markiert)
$speicher[4] = $markiert
EndFunc ;==>d
Der Taschenrechner ist so gut wie fertig, nur die Funktion, dass ein Graph gezeichnet werden kann, fehlt leider.
Um selber sowas zu schreiben, reicht mein Knowhow leider nicht aus. Skripte von anderen, die das shcon programmiert haben, einzufügen, funktioniert auch nicht richtig.
Der Job eines fleißigen Helfers wäre jetzt, nen Graphenzeichner mit Zoomfunktion einzubauen und ansonsten nix an dem Skript zu verändern.
Schon ma danke,
gruß, billie
Edit: Eine Funktion die man von vielen GTR/CAS kennt, wäre toll:
eine Auflistung mit y1 bis y10(-> 10 inputs)