Sign in to follow this  
Followers 0
anwarbham

loading previous settings

5 posts in this topic

hi most of you probably know im trying to create a reminder system that can set reminders for multiple items i have it working by reminding you of one item (item = a user input like numbers or letters)so the user will eneter in input select a box to remind him of this input in lets say 3 hours and in 3 hours he will get a pop up box that remonds him now thus far i can only get to remind the user for one item at a time so i have to wait for the first item to finish its process before i can continue and add another item to remind the user. now is this possible or am i just wasting time i also have another question.

lets say there was a reminder set for 3 hours and the user logs off his machine of shuts the mahine down

when he logs back in is there a way that resumes the process from were it left off or take in to account how many minutes or hours have passed

#include <GuiConstants.au3>

#include <Date.au3>

; GUI

GuiCreate("suspension test", 400, 400)

GuiSetIcon(@SystemDir & "\mspaint.exe", 0)

; cref inputbox

GuiCtrlCreateLabel("Cref Please",40, 20, 40,40)

$Crefinput = GuiCtrlCreateInput( "",40, 60, 90, 20) ; cref read command

; all problems that are suspended will be displayed here

$listView = GuiCtrlCreateListView("username|Cnumber", 40, 100,130, 110)

GuiCtrlCreateListViewItem(GUICtrlRead ($Crefinput), GUICtrlRead ($Crefinput))

; contact CHECKBOXs every time u contact the user

$1st=GuiCtrlCreateCheckbox("1st call attempt", 40, 230, 180, 20)

$1stonehour=GuiCtrlCreateCheckbox("2nd call attempt after one hour", 40, 250, 180, 20)

$24hoursuspend=GuiCtrlCreateCheckbox("suspended till 24 hours", 40, 270, 180, 20)

$5dayclousure=GuiCtrlCreateCheckbox("5 day closure sent", 40, 290, 180, 20)

; creates the notes box were it displays what actions have been done

GuiCtrlCreateLabel("Notes",176, 30, 40,40)

$notes = GUICtrlCreateEdit ("tried to contact user", 176,60,200,150,$ES_AUTOVSCROLL+$WS_VSCROLL)

; suspend BUTTON will suspend the call

$Sendmailbutton = GuiCtrlCreateButton("Send mail", 40, 330, 100, 30)

GuiSetState()

GUIGetMsg()

;---------------------------------------------------

; the user ticks the 1st contact checkbox

Do

$1stcheckboxread = GUICtrlRead ( $1st ) ; reads the data from the 1st checkbox

if $1stcheckboxread = $GUI_CHECKED then ; if the inputs from 1st checkbox it true then

$1stmessagebox = MsgBox(4096+4, "Call conformation", "did you contact the user") ;ask the user if he made contact

if $1stmessagebox = 6 Then ; if user made contact then

GUICtrlSetData ( $notes," "& _Now() & " Contacted user " , " default " ) ; contacted user cc

ExitLoop

MsgBox(0, "yes", "yes");test setup ignore this

Else ; other wise

GUICtrlSetData ( $notes," "& _Now() & " user not in suspending for one hour till " &"" & _DateAdd( 'h',1, _NowCalc()) , " default " ) ; this is not working should insert text in edit box

twentyfoursuspend()

ExitLoop

EndIf

endif

until $Sendmailbutton = 0

;---------------- this is the 2nd call attemp code list

Do

$afteronehourread = GUICtrlRead ( $1stonehour ) ; reads the data from the 2nd checkbox afer one hour

if $afteronehourread = $GUI_CHECKED then ; if the inputs from 2nd checkbox it true then

$2ndmessagebox = MsgBox(4096+4, "Call conformation", "did you contact the user") ;ask the user if he made contact

if $2ndmessagebox = 6 Then ; if user made contact then

GUICtrlSetData ( $notes," "& _Now() & " Contacted user " , " default " ) ; contacted user cc

ExitLoop

MsgBox(0, "yes", "yes");test setup ignore this

Else ; other wise

GUICtrlSetData ( $notes," "& _Now() & " user not in 2nd attempt suspending for 24 hours till " &"" & _DateAdd( 'h',24, _NowCalc()) , " default " ) ; this is not working should insert text in edit box

onehoursuspend()

ExitLoop

EndIf

endif

Until $Sendmailbutton = 4

;---------------- this is the 3rd call attemp code list

Do

$24hourread = GUICtrlRead ( $24hoursuspend ) ; reads the data from the 3rd checkbox afer 24 hours

if $24hourread = $GUI_CHECKED then ; if the inputs from 3rd checkbox it true then

$24messagebox = MsgBox(4096+4, "Call conformation", "did you contact the user") ;ask the user if he made contact

if $24messagebox = 6 Then ; if user made contact then

GUICtrlSetData ( $notes," "& _Now() & " Contacted user " , " default " ) ; contacted user cc

ExitLoop

Else ; other wise

GUICtrlSetData ( $notes," "& _Now() & " user not in 3rd attempt suspending for 5 days then close " &"" & _DateAdd( 'd',5, _NowCalc()) , " default " ) ; this is not working should insert text in edit box

onehoursuspend()

ExitLoop

EndIf

endif

Until $Sendmailbutton = 4

;------------------- this is the five day suspension bit

Do

$5dayread = GUICtrlRead ( $5dayclousure ) ; reads the data from the 4th checkbox afer 5days

if $5dayread = $GUI_CHECKED then ; if the inputs from 4th checkbox it true then

$5daymessagebox = MsgBox(4096+4, "Call conformation", "did you contact the user") ;ask the user if he made contact

if $5daymessagebox = 6 Then ; if user made contact then

GUICtrlSetData ( $notes," "& _Now() & " Contacted user " , " default " ) ; contacted user cc

ExitLoop

Else ; other wise

GUICtrlSetData ( $notes," "& _Now() & " user not in 4th attempt after 5 day suspension closing call " , " default " ) ; this is not working should insert text in edit box

onehoursuspend()

ExitLoop

EndIf

endif

Until $Sendmailbutton = 4

Func onehoursuspend()

sleep (50000)

splashTextOn("Call Alert", " THIS CALL NEEDS TO BE LOOKED AT "& GUICtrlRead ($Crefinput), -1, -1, -1, -1, 4, "", 24)

MsgBox(4096, "Alert", "By clicking OK you are confirming that you have contacted the user")

SplashOff()

EndFunc

Func twentyfoursuspend()

sleep (50000)

splashTextOn("Call Alert", " THIS CALL NEEDS TO BE LOOKED AT " & GUICtrlRead ($Crefinput), -1, -1, -1, -1, 4, "", 24)

MsgBox(4096, "Alert", "By clicking OK you are confirming that you have contacted the user")

SplashOff()

EndFunc

Share this post


Link to post
Share on other sites



hi most of you probably know im trying to create a reminder system that can set reminders for multiple items i have it working by reminding you of one item (item = a user input like numbers or letters)so the user will eneter in input select a box to remind him of this input in lets say 3 hours and in 3 hours he will get a pop up box that remonds him now thus far i can only get to remind the user for one item at a time so i have to wait for the first item to finish its process before i can continue and add another item to remind the user. now is this possible or am i just wasting time i also have another question.

lets say there was a reminder set for 3 hours and the user logs off his machine of shuts the mahine down

when he logs back in is there a way that resumes the process from were it left off or take in to account how many minutes or hours have passed

#include <GuiConstants.au3>

#include <Date.au3>

; GUI

GuiCreate("suspension test", 400, 400)

GuiSetIcon(@SystemDir & "\mspaint.exe", 0)

; cref inputbox

GuiCtrlCreateLabel("Cref Please",40, 20, 40,40)

$Crefinput = GuiCtrlCreateInput( "",40, 60, 90, 20) ; cref read command

; all problems that are suspended will be displayed here

$listView = GuiCtrlCreateListView("username|Cnumber", 40, 100,130, 110)

GuiCtrlCreateListViewItem(GUICtrlRead ($Crefinput), GUICtrlRead ($Crefinput))

; contact CHECKBOXs every time u contact the user

$1st=GuiCtrlCreateCheckbox("1st call attempt", 40, 230, 180, 20)

$1stonehour=GuiCtrlCreateCheckbox("2nd call attempt after one hour", 40, 250, 180, 20)

$24hoursuspend=GuiCtrlCreateCheckbox("suspended till 24 hours", 40, 270, 180, 20)

$5dayclousure=GuiCtrlCreateCheckbox("5 day closure sent", 40, 290, 180, 20)

; creates the notes box were it displays what actions have been done

GuiCtrlCreateLabel("Notes",176, 30, 40,40)

$notes = GUICtrlCreateEdit ("tried to contact user", 176,60,200,150,$ES_AUTOVSCROLL+$WS_VSCROLL)

; suspend BUTTON will suspend the call

$Sendmailbutton = GuiCtrlCreateButton("Send mail", 40, 330, 100, 30)

GuiSetState()

GUIGetMsg()

;---------------------------------------------------

; the user ticks the 1st contact checkbox

Do

$1stcheckboxread = GUICtrlRead ( $1st ) ; reads the data from the 1st checkbox

if $1stcheckboxread = $GUI_CHECKED then ; if the inputs from 1st checkbox it true then

$1stmessagebox = MsgBox(4096+4, "Call conformation", "did you contact the user") ;ask the user if he made contact

if $1stmessagebox = 6 Then ; if user made contact then

GUICtrlSetData ( $notes," "& _Now() & " Contacted user " , " default " ) ; contacted user cc

ExitLoop

MsgBox(0, "yes", "yes");test setup ignore this

Else ; other wise

GUICtrlSetData ( $notes," "& _Now() & " user not in suspending for one hour till " &"" & _DateAdd( 'h',1, _NowCalc()) , " default " ) ; this is not working should insert text in edit box

twentyfoursuspend()

ExitLoop

EndIf

endif

until $Sendmailbutton = 0

;---------------- this is the 2nd call attemp code list

Do

$afteronehourread = GUICtrlRead ( $1stonehour ) ; reads the data from the 2nd checkbox afer one hour

if $afteronehourread = $GUI_CHECKED then ; if the inputs from 2nd checkbox it true then

$2ndmessagebox = MsgBox(4096+4, "Call conformation", "did you contact the user") ;ask the user if he made contact

if $2ndmessagebox = 6 Then ; if user made contact then

GUICtrlSetData ( $notes," "& _Now() & " Contacted user " , " default " ) ; contacted user cc

ExitLoop

MsgBox(0, "yes", "yes");test setup ignore this

Else ; other wise

GUICtrlSetData ( $notes," "& _Now() & " user not in 2nd attempt suspending for 24 hours till " &"" & _DateAdd( 'h',24, _NowCalc()) , " default " ) ; this is not working should insert text in edit box

onehoursuspend()

ExitLoop

EndIf

endif

Until $Sendmailbutton = 4

;---------------- this is the 3rd call attemp code list

Do

$24hourread = GUICtrlRead ( $24hoursuspend ) ; reads the data from the 3rd checkbox afer 24 hours

if $24hourread = $GUI_CHECKED then ; if the inputs from 3rd checkbox it true then

$24messagebox = MsgBox(4096+4, "Call conformation", "did you contact the user") ;ask the user if he made contact

if $24messagebox = 6 Then ; if user made contact then

GUICtrlSetData ( $notes," "& _Now() & " Contacted user " , " default " ) ; contacted user cc

ExitLoop

Else ; other wise

GUICtrlSetData ( $notes," "& _Now() & " user not in 3rd attempt suspending for 5 days then close " &"" & _DateAdd( 'd',5, _NowCalc()) , " default " ) ; this is not working should insert text in edit box

onehoursuspend()

ExitLoop

EndIf

endif

Until $Sendmailbutton = 4

;------------------- this is the five day suspension bit

Do

$5dayread = GUICtrlRead ( $5dayclousure ) ; reads the data from the 4th checkbox afer 5days

if $5dayread = $GUI_CHECKED then ; if the inputs from 4th checkbox it true then

$5daymessagebox = MsgBox(4096+4, "Call conformation", "did you contact the user") ;ask the user if he made contact

if $5daymessagebox = 6 Then ; if user made contact then

GUICtrlSetData ( $notes," "& _Now() & " Contacted user " , " default " ) ; contacted user cc

ExitLoop

Else ; other wise

GUICtrlSetData ( $notes," "& _Now() & " user not in 4th attempt after 5 day suspension closing call " , " default " ) ; this is not working should insert text in edit box

onehoursuspend()

ExitLoop

EndIf

endif

Until $Sendmailbutton = 4

Func onehoursuspend()

sleep (50000)

splashTextOn("Call Alert", " THIS CALL NEEDS TO BE LOOKED AT "& GUICtrlRead ($Crefinput), -1, -1, -1, -1, 4, "", 24)

MsgBox(4096, "Alert", "By clicking OK you are confirming that you have contacted the user")

SplashOff()

EndFunc

Func twentyfoursuspend()

sleep (50000)

splashTextOn("Call Alert", " THIS CALL NEEDS TO BE LOOKED AT " & GUICtrlRead ($Crefinput), -1, -1, -1, -1, 4, "", 24)

MsgBox(4096, "Alert", "By clicking OK you are confirming that you have contacted the user")

SplashOff()

EndFunc

the easiest way to do everything you want would probably be with registry entries, or text file I/O.

that's a good idea for a script...i think i'll whip one up too...i think i'm going to do it a little differently though, do you want me to pm you my code when it's done?


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

the easiest way to do everything you want would probably be with registry entries, or text file I/O.

that's a good idea for a script...i think i'll whip one up too...i think i'm going to do it a little differently though, do you want me to pm you my code when it's done?

here's my code for a very simple reminder app... you wouldn't have to add much code to specify date etc...

#include<GUIConstants.au3>
Opt("GUIOnEventMode", 1)
$main = GUICreate("Reminder Main",120,70)
$new = GUICtrlCreateButton("New Reminder",10,10,100)
$list = GUICtrlCreateButton("Current Reminders",10,40,100)
GUICtrlSetOnEvent($list,"ListRems")
GUICtrlSetOnEvent($new,"Addnew")

GUISetState(@sw_show)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
while 1
    sleep(100)
while 1
    
    $i = 1

    $var = RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\REMINDER", $i)
    If @error <> 0 then 
        ExitLoop
    EndIf
    $time = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\REMINDER",$var)
    $HOUR = Number(StringLeft($time,2))
    if StringInStr($time,"P") then $hour = $hour + 12
        
    if $hour = @hour Then
        if Number(StringMid($time,4,2)) = @min Then
            $snooze = MsgBox(4,"Reminder",$var & @crlf & "Do you want to be reminded again in 5 minutes?")
            if $snooze = 6 Then
                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\REMINDER",$VAR,"REG_SZ",StringLeft($time,2) & ":" & @MIN +5)
            Else
                RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\REMINDER",$VAR)
            EndIf
        EndIf
    Else
    ;MsgBox(0,"test",number(stringleft($time,2)) & @crlf & @hour)
    EndIf
    $i = $i + 1
WEnd
WEnd
Func CLOSEClicked()
    Exit
EndFunc



Func Addnew()
$name = ""
while StringLen($name)< 2
$name = InputBox("Name","Please enter a name for your new reminder")
WEnd
$time = InputBox("Time","Please enter a time for the reminder " & Chr(34) & " to be displayed. Please use HH:MMA/P")
$rw = RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\REMINDER",$name,"REG_SZ",$time)
EndFunc





Func ListRems()
$i = 1
while 1
    $var = RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\REMINDER", $i)
    If @error <> 0 then 
        ExitLoop
    EndIf
    $DELETE = MsgBox(4, "Reminder #" & $i, "Do you wish to delete this reminder?" & @crlf & @crlf & @crlf & $var & "     " & RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\REMINDER",$var))
    IF $delete = 6 Then
        RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\REMINDER",$var)
    EndIf
    $i = $i + 1
WEnd

EndFunc

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

hey thats a cool script but what about if the machine is switched off and back on again i was thinking of saving the reminders in an ini file and when you reopen the app it looks in the ini file for the current reminders and resumes were it left off

Share this post


Link to post
Share on other sites

hey thats a cool script but what about if the machine is switched off and back on again i was thinking of saving the reminders in an ini file and when you reopen the app it looks in the ini file for the current reminders and resumes were it left off

the way that i have the reminders saved in the registry, all reminders will be saved even if the machine is rebooted.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0