Breadfish.de - Foren Ticker (COM|GDI+)
if not A_IsAdmin
{
Run *RunAs "%A_ScriptFullPath%"
ExitApp
}
if (a_iscompiled){
if(!FileExist("Bread_Sound.mp3"))
FileInstall,Bread_Sound.mp3,Bread_Sound.mp3,0
}else{
FileInstall,Bread_Sound.mp3,Bread_Sound.mp3,0
}
#Persistent
#SingleInstance force
#NoEnv
#include gdip.ahk
global pToken := Gdip_Startup()
if(!pToken)
exitapp
global _Interval := 5*1000*60
OnExit, Exit
if(!FileExist("Log.ini"))
{
IniWrite,% "", Log.ini, Login-Daten, Username
IniWrite,% "", Log.ini, Login-Daten, Passwort
Run % "Log.ini"
Msgbox % "Trage deine Benutzerdaten in die Log.ini (:D Sry Flachwitz...) ein.`nStarte anschliessend das Programm neu."
Exitapp
}else{
IniRead, _USERNAME, Log.ini, Login-Daten, Username
IniRead, _PASSWORT, Log.ini, Login-Daten, Passwort
if(_USERNAME == "" || _PASSWORT == "")
{
Run % "Log.ini"
Msgbox % "Trage deine Benutzerdaten in die Log.ini (:D Sry Flachwitz...) ein.`nStarte anschliessend das Programm neu."
Exitapp
}
global _USERNAME := _USERNAME
global _PASSWORT := _PASSWORT
Gui, 1: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs
Gui, 1: Add, Text, w140 h20 y300,
Gui, 1: Show, NA
global hwnd1 := WinExist()
Settimer, CheckNotification, %_Interval%
}
CheckNotification:
Bread := GetBreadfishNotifications()
If(Bread.Benachrichtigungen >= 1 || Bread.Konversationen >= 1){
SoundPlay, Bread_Sound.mp3
SetToolTipEx(hwnd1,10000,Bread.Konversationen,Bread.Benachrichtigungen)
}
return
GetBreadfishNotifications()
{
IEX := ComObjCreate("InternetExplorer.Application")
IEX.Visible := False
IEX.Navigate("http://www.Breadfish.de")
While(IEX.busy)
sleep, 10
IEX.document.getElementById("username").value := _USERNAME
IEX.document.getElementById("password").value := _PASSWORT
IEX.document.getElementById("loginSubmitButton").click()
While(IEX.busy)
sleep, 10
RegExMatch(Trim(IEX.document.All.item["userNotifications"].innerText),"Benachrichtigungen ([0-9]+)",RegNot)
RegExMatch(Trim(IEX.document.All.item["unreadConversations"].innerText),"Konversationen ([0-9]+)",RegKon)
GBN_OBJECT := {Benachrichtigungen: strlen(RegNot1) >= 1 ? RegNot1 : 0
, Konversationen: strlen(RegKon1) >= 1 ? RegKon1 : 0}
IEX.quit
IEX := ""
return GBN_OBJECT
}
SetToolTipEx(STTE_HWND,STTE_TIME:=3000,STTE_MESCOUNT:=0,STTE_NOTCOUNT:=0)
{
if(STTE_MESCOUNT == 0 && STTE_NOTCOUNT == 0 || STTE_HWND == 0x0)
return
Gui, 1: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs
Gui, 1: Add, Text, w140 h20 y300,
Gui, 1: Show, NA
global hwnd1 := WinExist()
if(STTE_TIME > 5000)
STTE_TIME := 5000
STTE_WEITE := 200
STTE_HÖHE := 200
STTE_FONT := "Verdana"
STTE_COLOR := {BackMain: 0xFF554D67,BackSEC: 0xFF5B647A,BorderMAIN: 0xFF020007, BorderSEC: 0xFF424243,INT: FF0A256A, ALPHA: FF000000}
hbm := CreateDIBSection(STTE_WEITE, STTE_HÖHE)
hdc := CreateCompatibleDC()
obm := SelectObject(hdc, hbm)
_G := Gdip_GraphicsFromHDC(hdc)
Gdip_SetCompositingMode(_G, 4)
Gdip_FillEllipse(_G, pBrush:= Gdip_CreateLineBrush(0, 0, 50, 50, STTE_COLOR.BorderMAIN, STTE_COLOR.BorderSEC,1), 0, 0, STTE_WEITE,STTE_HÖHE)
Gdip_FillEllipse(_G, pBrush2:= Gdip_CreateLineBrush(0, 0, 50, 50, STTE_COLOR.BackSEC, STTE_COLOR.BackMain,1), 5, 5, STTE_WEITE-10, STTE_HÖHE-10)
If(!Gdip_FontFamilyCreate(STTE_FONT))
Gdip_FontFamilyCreate("Arial")
TEXTPOS := {Y:10,H:10}
Gdip_TextToGraphics(_G, "Breadfish.de","y" TEXTPOS.Y "p h" TEXTPOS.H "p c" STTE_COLOR.ALPHA " s12 Centre Underline Italic Bold", STTE_FONT, STTE_WEITE, STTE_HÖHE)
Gdip_TextToGraphics(_G, "","y" (TEXTPOS.Y:=(TEXTPOS.Y+TEXTPOS.H)) "p h" TEXTPOS.H "p", STTE_FONT, STTE_WEITE, STTE_HÖHE) ; Leere Zeile
Gdip_TextToGraphics(_G, "Hey, " _USERNAME " du hast..." ,"y" (TEXTPOS.Y:=(TEXTPOS.Y+TEXTPOS.H)) "p h" TEXTPOS.H "p c" STTE_COLOR.ALPHA " s11 Centre Italic", STTE_FONT, STTE_WEITE, STTE_HÖHE)
if(STTE_MESCOUNT){
Gdip_TextToGraphics(_G, STTE_MESCOUNT,"x8p y" (NEXTY := TEXTPOS.Y:=(TEXTPOS.Y+TEXTPOS.H)) "p h" TEXTPOS.H "p w20p c" STTE_COLOR.INT " s12 Left Bold", STTE_FONT, STTE_WEITE, STTE_HÖHE)
Gdip_TextToGraphics(_G, STTE_MESCOUNT == 1 ? " ungelesene Nachricht!" : " ungelesene Nachrichten!","x13p y" NEXTY "p h" TEXTPOS.H "p c" STTE_COLOR.ALPHA " s12 Left", STTE_FONT, STTE_WEITE, STTE_HÖHE)
}
if(STTE_NOTCOUNT){
Gdip_TextToGraphics(_G, STTE_NOTCOUNT,"x8p y" (NEXTY := TEXTPOS.Y:=(TEXTPOS.Y+TEXTPOS.H)) "p h" TEXTPOS.H "p w20p c" STTE_COLOR.INT " s12 Left Bold", STTE_FONT, STTE_WEITE, STTE_HÖHE)
Gdip_TextToGraphics(_G, STTE_NOTCOUNT == 1 ? " ungesehenes Thema!" : " ungesehene Themen!","x13p y" NEXTY "p h" TEXTPOS.H "p c" STTE_COLOR.ALPHA " s12 Left", STTE_FONT, STTE_WEITE, STTE_HÖHE)
}
Gdip_TextToGraphics(_G, "`nby Renz","x25p y" (TEXTPOS.Y:=(TEXTPOS.Y+TEXTPOS.H)) "p h" TEXTPOS.H "p Center c" STTE_COLOR.ALPHA , STTE_FONT, STTE_WEITE, STTE_HÖHE) ; Leere Zeile
UpdateLayeredWindow(STTE_HWND, hdc, (A_ScreenWidth-STTE_WEITE)//2, (A_ScreenHeight-STTE_WEITE)//2, STTE_WEITE, STTE_HÖHE)
OnMessage(0x201, "WM_LBUTTONDOWN")
Gdip_DeleteBrush(pBrush)
Gdip_DeleteBrush(pBrush2)
SelectObject(hdc, obm)
DeleteObject(hbm)
DeleteDC(hdc)
Gdip_DeleteGraphics(_G)
sleep %STTE_TIME%
gosub DelTip
Return
}
DelTip:
Try Gui, 1: Destroy
return
WM_LBUTTONDOWN()
{
PostMessage, 0xA1, 2
}
Exit:
Gdip_Shutdown(pToken)
ExitApp
Return
Alles anzeigen
Desktop Ausgabe:
Erfolgsystem Include| Kundenwusch | .txt basierend
Da die Person ihren Teil des Vertrages nicht eingehalten hat (Es erfolgte keine Bezahlung) Release ich es mit als Teil der Referenzen.
;Quests Vars
;----------------
global Q_Name = 1
global Q_Info = 2
global Q_Prog = 3
global Q_Max = 4
global Q_EXP = 5
global Q_STATUS = 6
global Q_TOTALEXP = 0
;----------------
;RegEX Formeln
global RegExQuest := "i)([a-zA-Z\s\.]+)/([a-zA-Z0-9\s\.]+)/([0-9]+)/([0-9]+)/([0-9\.]+)/([0-1])"
global RegExQuestSettings := "([0-9]+)/"
global RegExTimeStamp := "U)^\[\d{2}:\d{2}:\d{2}\] "
global RegExColor := "{\S{6}}"
;----------------
Col := {Main: "FFFFFF",Sec: "3651A8"}
;Objekte
global Quest := Object()
BuildArray()
{
If(Quest.MAxIndex() > 0){
While(Quest.MaxIndex())
Quest.RemoveAt(Quest.MaxIndex())
}
FileRead, QuestFILECONTENT, Questlist.txt
Loop, parse, QuestFILECONTENT, `n, `r
{
if(Found := RegExMatch(A_Loopfield, RegExQuest, REGEXARR))
Quest.Push([ REGEXARR1 , REGEXARR2 , REGEXARR3 , REGEXARR4 , REGEXARR5 , REGEXARR6 ])
if(Found := RegExMatch(A_Loopfield, RegExQuestSettings, REGEXARR))
Q_TOTALEXP := REGEXARR1
}
QuestFILECONTENT := ""
return
}
GetQuestName(GAN_ID)
{
return Quest[ GAN_ID , Q_Name ]
}
GetTotalEXP()
{
global
return Q_TOTALEXP
}
SetTotalEXP(byInt)
{
If(IsInteger(byInt)){
return Q_TOTALEXP := Q_TOTALEXP + byInt
}else{
return -1
}
}
SetQuestValue(SAV_NameOrID,SAV_Value)
{
If(IsInteger(SAV_NameOrID))
if(SAV_NameOrID >= Quest.MinIndex() && SAV_NameOrID <= Quest.MaxIndex())
return Quest[ SAV_NameOrID , Q_Prog ] := SAV_Value
else
return -1
else
strlen(SAV_NameOrID) == 0 ? return -1 : return Quest[ GetQuestID(SAV_NameOrID) , Q_Prog ] := SAV_Value
}
IncreaseQuestValuebyStep(IAVBS_Name,IAVBS_Value)
{
IsInteger(IAVBS_Name) ? "" : IAVBS_Name := GetQuestID(IAVBS_Name)
if(IAVBS_Value >= 2 || IAVBS_Value <= 0 || IAVBS_Name == "" || IAVBS_Name == -1)
return -1
Quest[ IAVBS_Name , Q_Prog ] += IAVBS_Value
if(Quest[ IAVBS_Name , Q_Prog ] == Quest[ IAVBS_Name , Q_MAX ] && !Quest[ IAVBS_Name , Q_STATUS ])
{
_tmpxp := GetTotalEXP()
AddChatMEssage("{FFFFFF}Herzlichen Glückwunsch! | Quest - {3651A8}" Quest[ IAVBS_Name , Q_NAME ] "{FFFFFF} abgeschlossen.")
AddChatMEssage("{FFFFFF}Deine Gesammt EXP stiegen von {3651A8}" _tmpxp "EXP{FFFFFF} auf {3651A8}" _tmpxp+Quest[ IAVBS_Name , Q_EXP ] " EXP{FFFFFF} | + {3651A8}" Quest[ IAVBS_Name , Q_EXP ] "EXP")
Quest[ IAVBS_Name , Q_STATUS ] := 1
SetTotalEXP(Quest[ IAVBS_Name , Q_EXP ])
RefreshQuestTXT()
return 1
}
AddChatMEssage("{FFFFFF}Fortschritt der Quest - {3651A8}" Quest[ IAVBS_Name , Q_NAME ] "{FFFFFF} - Wert: {3651A8}" Quest[ IAVBS_Name , Q_PROG ] "{FFFFFF}/{3651A8}" Quest[ IAVBS_Name , Q_MAX ] )
RefreshQuestTXT()
return 1
}
GetQuestStatus(GQS_NameOrID)
{
If(IsInteger(GQS_NameOrID)){
return Quest[ GAV_NameOrID , Q_STATUS ]
}else{
if(strlen(GQS_NameOrID) == 0)
return -1
return Quest[ GetQuestID(GQS_NameOrID) , Q_STATUS ]
}
}
GetQuestValue(GAV_NameOrID)
{
If(IsInteger(GAV_NameOrID)){
return Quest[ GAV_NameOrID , Q_Prog ]
}else{
if(strlen(GAV_NameOrID) == 0)
return -1
While(Quest.MaxIndex() != A_Index){
if(Quest[ A_Index , Q_Name ] != GAV_NameOrID)
Continue
return Quest[ A_Index , Q_Prog ]
}
}
return 0
}
RefreshQuestTXT()
{
FileDelete Questlist.txt
While(A_Index <= Quest.MaxIndex())
TxtContent .= Quest[ A_Index , Q_Name ] "/" Quest[ A_Index , Q_Info ] "/" Quest[ A_Index , Q_Prog ] "/" Quest[ A_Index , Q_Max ] "/" Quest[ A_Index , Q_EXP ] "/" Quest[ A_Index , Q_STATUS ] "`n"
TxtContent .= GetTotalEXP() "/"
Fileappend, %TxtContent% , Questlist.txt
BuildArray()
return
}
GetQuestID(GAI_Name)
{
if(strlen(GAI_Name) <= 1)
return -1
While(Quest.MaxIndex() >= A_Index)
{
if(Quest[ A_Index , Q_Name ] == GAI_Name)
return A_Index
}
return 0
}
ClearVar(CV_Name)
{
return VarSetCapacity(CV_Name, 0)
}
CountRowsInFile(CRIF_FILENAME,FullRead:=False)
{
local CRIF_FILEPATH := CRIF_FILENAME
local CRIF_FILEPATH .= instr(CRIF_FILENAME,".txt",0,1,1) ? "" : ".txt"
FileRead, CRIF_FILESTRING , % CRIF_FILEPATH
Loop, parse, CRIF_FILESTRING, `n, `r
CRIF_COUNT++
return FullRead ? CRIF_COUNT : CRIF_COUNT-1
}
Debugf(Varx,ResetCounter:=False) {
static _stepcount
_stepcount++
Msgbox % "(" _stepcount ") Eingabe: " Varx
if(ResetCounter == True)
_stepcount := ""
}
IsInteger(p_StrToCheck) {
if p_StrToCheck is integer
return p_StrToCheck
return 0
}
ReadSAMPLog(SearchFor,Params*)
{
local RSL_OBJECT := Object()
RSL_LOGPATH := A_MyDocuments . "/GTA San Andreas User Files/SAMP/chatlog.txt"
FileGetSize, RSL_NEWFILESIZE , % RSL_LOGPATH
If(RSL_OLDFILESIZE < RSL_NEWFILESIZE)
{
RSL_SAMPLOG := FileOpen(RSL_LOGPATH,"r")
Loop{
RSL_ROW := RSL_SAMPLOG.ReadLine()
RSL_ROW := RegExReplace(RSL_ROW, RegExTimeStamp)
RSL_ROW := RegExReplace(RSL_ROW, RegExColor, "")
RSL_ROW := StrReplace(RSL_ROW, "`r`n")
RSL_ROW := StrReplace(RSL_ROW, "`r")
if(RSL_ROW != "")
RSL_OBJECT.Push(RSL_ROW)
}Until RSL_SAMPLOG.AtEOF
if(Params.MaxIndex() == 1 && Params[1] < 0){
While(A_Index <= StrReplace(Params[1], "-")){
if(FoundIT := RegExMatch("(.*) " RSL_OBJECT[ RSL_OBJECT.MaxIndex()-A_Index ] " (.*)", SearchFor)){
FileGetSize, RSL_OLDFILESIZE , % RSL_LOGPATH
RSL_SAMPLOG.Close()
break
}
}
}else{
for _i,linenr in Params {
if(FoundIT := RegExMatch("(.*) " RSL_OBJECT[RSL_OBJECT.MaxIndex()-linenr] " (.*)", SearchFor)){
FileGetSize, RSL_OLDFILESIZE , % RSL_LOGPATH
RSL_SAMPLOG.Close()
break
}
}
}
return FoundIT ? True : False
}
}
Alles anzeigen