Jump to content

byteme

Active Members
  • Posts

    43
  • Joined

  • Last visited

byteme's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Greetings to all, I am having some problems with a script. I need to be able to color code different lines in a ListView, depending on what is written on that line. I have some code here and I hope it explains what I am looking to do. This is just a shell of what I have, but I can post the entire code if needed. When I update the Listview by putting information on a line, the line might end with *, but other lines do not. I am looking to make the lines that end with * colored red, and the other lines that do not end with * either green or the default Listview color. Any help\suggestions would be appreciated. I did look on the forums and in the help file, but all I can come up with is how to make ALL of the lines a certain color, not just the ones I need. Thank you! Byteme Code: #include <GUIConstants.au3> #include <file.au3> #include <guiedit.au3> #Include <GuiList.au3> #Include <GuiListView.au3> #Include <Date.au3> Dim $aRecords Dim $aRecords2 Dim $aRecords3 Dim $dont Dim $tmp Dim $path2File dim $b $Form1 = GUICreate("Ignore List", 800, 447, @DesktopWidth / 2 - 400, @DesktopHeight / 2 - 223) If Not FileExists("c:\windows\web\wallpaper\ripple.jpg") Then GUISetBkColor(0x153E7E) $tmp = 1 Else GUICtrlCreatePic("c:\windows\web\wallpaper\ripple.jpg", -1, -1, 800, 447) EndIf GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateLabel("Servers Currently in Ignore List", 235, 5, 300, 27) If $tmp = 1 Then GUICtrlSetBkColor(-1, 0x153E7E) Else GUICtrlSetBkColor(-1, 0x38ACEC) EndIf GUICtrlSetFont(-1, 17) If $tmp = 1 Then GUICtrlSetColor(-1, 0xE0FFFF) EndIf $list1 = GUICtrlCreateListView("ServerName|GroupWhoAdded|DateAdded|BlackoutTimeLimit|Time2BeUp|Exceeded", 10, 40, 780, 300) _GUICtrlListViewSetColumnWidth($list1, 0, 150) _GUICtrlListViewSetColumnWidth($list1, 1, 150) _GUICtrlListViewSetColumnWidth($list1, 2, 150) _GUICtrlListViewSetColumnWidth($list1, 3, 105) _GUICtrlListViewSetColumnWidth($list1, 4, 150) _GUICtrlListViewSetColumnWidth($list1, 5, 70) ; in original script, only one guictrllistviewinsertitem. ; the script reads a file to an array. the file contains lines like below ; once array is built, it runs one of the insertitems for each one and adds to gui ; some lines end with "*".....if so, I want to make those lines red. ; if the line does not end with "*" i want to make them either green or keep default color...anything but red _GUICtrlListViewInsertItem($list1, -1, "abc|mygroup1|05/04/2009 10:08:46 am|00:30:00|05/04/2009 10:38:46 am|") _GUICtrlListViewInsertItem($list1, -1, "def|mygroup2|05/04/2009 10:08:46 am|00:20:00|05/04/2009 10:28:46 am|*") _GUICtrlListViewInsertItem($list1, -1, "ghi|mygroup6|05/04/2009 10:08:46 am|00:30:00|05/04/2009 10:38:46 am|") _GUICtrlListViewInsertItem($list1, -1, "jkl|mygroup4|05/04/2009 10:08:46 am|00:20:00|05/04/2009 10:28:46 am|*") _GUICtrlListViewInsertItem($list1, -1, "mno|mygroup3|05/04/2009 10:08:46 am|00:30:00|05/04/2009 10:38:46 am|") _GUICtrlListViewInsertItem($list1, -1, "pqr|mygroup8|05/04/2009 10:08:46 am|00:20:00|05/04/2009 10:28:46 am|*") ; these controls do not work at this time....just giving bare coding here.... $add = GUICtrlCreateButton("Add", 230, 350, 81, 33, 0) $remove2 = GUICtrlCreateButton("Remove", 360, 350, 81, 33, 0) $save = GUICtrlCreateButton("Save to CSV", 490, 350, 81, 33, 0) $exit = GUICtrlCreateButton("Exit", 270, 400, 275, 33, 0) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $list1 _GUICtrlListViewSort($list1, $B_DESCENDING, GUICtrlGetState($list1)) Case Else EndSelect WEnd
  2. No problem Valuater. Your XSkin is one of the greatest things to come for AutoIt in quite a while! I always liked the way my gui's looked, but always thought they were kinda bland. Now with XSkin, anything is possible. Very nice work! Byteme
  3. Hi Beefteck. If you are looking for RGB codes, here is a nice place to get them... I've been using them in Autoit scripts for a while now. Just grab the Hexadecimal value and you are all set. http://www.pitt.edu/~nisg/cis/web/cgi/rgb.html hope this helps! Byteme
  4. were you typing into the 5 boxes at the top, or the input box under the Mystery Word picture? I just tried it and that's what I think is happening. because of the screen resolution, maybe people aren't seeing all of the input boxes and buttons. what you should see are the 5 input boxes at the top(should probably be labels) MysteryWord picture an inputbox to type your guess 3 buttons at the bottom, Hint Earn Extra Cash Quit and halfway down on the right side, number of guesses left. it works quite well if you don't type in the input boxes at the top. maybe it was stupid to post this since the resolution is probably making a mess of things. I just wanted a bigger window that would work at any resolution, and when I couldn't figure it out, I put the screenres function in. Byteme
  5. what doesn't seem to work for people? If you put all of the files in your temp folder, then run it, you just type in your guess and hit enter. if you get some letters correct, it will put the correct letter in the box. if you guess some letters that are in the word, just not where you guessed, they show up under the box. this should work for anybody... Byteme
  6. Hi everybody! I have asked some questions in the forum on how to do some things in a script I was writing just for fun at work and I see that big_daddy has made a fun Hangman game kinda based on it (which I think is really nice!). I thought I would post my MysteryWord game out just to see what people think of it. Mind you, my scripting isn't nearly as good as anybody here in the forum, but it was fun to do this anyway. I am attaching all the files in a zip file, but I know many (most) people are not really willing to trust people right away so I can post the files separate (there are over 10 files if I include the sounds. I can post just the codes if wanted). I'm sure there are a few bugs, and many different\easier ways to do what I did, but it works! let me know what you think, ok? Thanks everybody! Byteme MysteryWord.zip
  7. Hi big_daddy, love the concept of hangman added! haha! Just wondering though, any chance you could post the script in something other than an .rar file? either winzip or just the files alone? I only have winzip and they won't allow other software here at work....thanks! byteme
  8. Wow, that's very nice! I haven't done much scripting, and I have seen the ie.au3 out there, but never looked at it. this will come in very handy! I like how you go to the net to grab the words and definitions. very nice. Byteme
  9. Hi Big d. I was the one who started this post, and i was looking at your code. I want to check it out because it looks very interesting. the problem is, I don't seem to have the ie.au3 file anywhere. I just installed v3.1.1.126 (beta) and I still don't have it. am I missing something here? any help would be appreciated....thanks! Byteme
  10. hahaha! sooo simple, yet I missed it! thank you once again and have a wonderful day! Byteme
  11. I'm sorry....Just one more question here. Right now when the gui opens, you click into the one input box where you can type your word. if you hit enter, the click function clicks on submit. after that, is there a way to make the inputbox for the user to type another word in automatically be active so they don't have to click into it first??? thank you all again.... Byteme
  12. Thank you marfdaman! I did have to change a couple lines, but you got me out of that stupid loop. Hope you do well on your tests! Have a nice day! Byteme
  13. Good morning everybody. I have a script I am trying to create, and I am having problems with restarting a gui. What I have so far is just a rough draft, things to be added later, but I need help. This is a 5 letter word guessing game and when you play, it picks a random 5 letter word from a file. It gives you the first letter, then you have to guess the rest. As you get any correct letters, it shows in the gui. Once you guessed the right word, it is supposed to start a new game, giving the new first letter. when I run this, it works up to the point you guess the correct word. Once you click OK on the message box that comes up, it should start over, but it tries to create the gui again, and just creates more "empty" gui's, making it hard to even stop the script. Any ideas on how I can get this to work correctly? I am attaching my "script". If it doesn't appear correctly, please let me know how to post a different way. As you will see, I probably did some things the hard\long way, but this is just a rough draft. Thank you for any help you can give. Byteme MyGame.au3
  14. Thank you for the kind words brandonm. I haven't checked this post in quite a while. did you still need help getting the files where you need them, or are you all set with this? (or give up on it??)
  15. thank you all for your help. I was able to get my script to work. Thanks again! -condoman-- nice script! i have pics all over my pc, so I think I might borrow your program to help me look at them easier....Thanks!
×
×
  • Create New...