[Help] ErrorLog C# menu

Shout-Out

User Tag List

Results 1 to 14 of 14
  1. #1
    snigelmannen's Avatar Member
    Reputation
    27
    Join Date
    Jul 2007
    Posts
    318
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Help] ErrorLog C#

    Hey another thing which i need help with.

    My current tool gets this when it fails to read the process and read from the process.




    so instead of the window, how can i print the messages to a text box?
    " Spy sappin mah sentry! "

    [Help] ErrorLog C#
  2. #2
    ReidE96's Avatar Archer Authenticator enabled
    Reputation
    470
    Join Date
    Dec 2006
    Posts
    1,625
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    snigelmannen's Avatar Member
    Reputation
    27
    Join Date
    Jul 2007
    Posts
    318
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Read about try and catch though didnt find that page, thanks
    " Spy sappin mah sentry! "

  4. #4
    ReidE96's Avatar Archer Authenticator enabled
    Reputation
    470
    Join Date
    Dec 2006
    Posts
    1,625
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Glad to help out

  5. #5
    snigelmannen's Avatar Member
    Reputation
    27
    Join Date
    Jul 2007
    Posts
    318
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well wall o crap inc


    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using Magic;
    
    namespace SnigelStatus
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            private void timer1_Tick(object sender, EventArgs e)
            {
                
                BlackMagic WoW = new BlackMagic();
                WoW.OpenProcessAndThread(SProcess.GetProcessFromProcessName("WoW.exe"));
                string PlayerName = WoW.ReadASCIIString(0x00C923F8, 12);
                uint PlayerBase = WoW.ReadUInt(WoW.ReadUInt(WoW.ReadUInt(0x00CF7C00) + 0x34) + 0x24);           
                uint CurHealth = WoW.ReadUInt(WoW.ReadUInt(PlayerBase + 0x8) + (0x17 * 4));
                uint MaxHealth = WoW.ReadUInt(WoW.ReadUInt(PlayerBase + 0x8) + (0x1F * 4));
                int HPPer = (int)(((double)CurHealth / (double)MaxHealth) * 100);
                progressBar1.Value = HPPer;
                       
            }
        }
    }
    How would you guys make that code execute only if there was a process, and if there wasnt it would write to my error log?
    Last edited by snigelmannen; 12-15-2009 at 05:01 PM.
    " Spy sappin mah sentry! "

  6. #6
    ReidE96's Avatar Archer Authenticator enabled
    Reputation
    470
    Join Date
    Dec 2006
    Posts
    1,625
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    try
    {
        WoW.OpenProcessAndThread(SProcess.GetProcessFromProcessName("WoW.exe"));
        string PlayerName = WoW.ReadASCIIString(0x00C923F8, 12);
        uint PlayerBase = WoW.ReadUInt(WoW.ReadUInt(WoW.ReadUInt(0x00CF7C00) + 0x34) + 0x24);           
        uint CurHealth = WoW.ReadUInt(WoW.ReadUInt(PlayerBase + 0x8) + (0x17 * 4));
        uint MaxHealth = WoW.ReadUInt(WoW.ReadUInt(PlayerBase + 0x8) + (0x1F * 4));
    }
    
    catch (Exception e)
    {
        Console.WriteLine("{0} Exception caught.", e);
    }

  7. #7
    snigelmannen's Avatar Member
    Reputation
    27
    Join Date
    Jul 2007
    Posts
    318
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the help will try it.
    " Spy sappin mah sentry! "

  8. #8
    snigelmannen's Avatar Member
    Reputation
    27
    Join Date
    Jul 2007
    Posts
    318
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm another question, ehm console writeline can that be change to the errorlog i have? like Error.Writeline?
    " Spy sappin mah sentry! "

  9. #9
    ReidE96's Avatar Archer Authenticator enabled
    Reputation
    470
    Join Date
    Dec 2006
    Posts
    1,625
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, you can do whatever you like with the error. That's just one option. The variable e is the exception.

  10. #10
    snigelmannen's Avatar Member
    Reputation
    27
    Join Date
    Jul 2007
    Posts
    318
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well i am getting an error when writing to that box but that's because its a richtextbox or w/e its called, cant use writeline with it, its something else that i gotta use.

    been looking it up but it still doesn't give any good answers.

    and thanks for the help with try - catch it doesn't crash anymore and just stays open when it doesn't find the process, though i had to move the whole code within the try catch. else it would fail, as stated not a coder i don't know how this all works.
    " Spy sappin mah sentry! "

  11. #11
    ReidE96's Avatar Archer Authenticator enabled
    Reputation
    470
    Join Date
    Dec 2006
    Posts
    1,625
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    richTextBox.AppendText() is the method you're after.

    Try-Catch works by trying to execute the code in the Try block, then catching any error that happened whilst doing so.

  12. #12
    snigelmannen's Avatar Member
    Reputation
    27
    Join Date
    Jul 2007
    Posts
    318
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well its working quite as i wanted now, just gotta learn how to truncate it some.




    Now i tried to add a error sound, it went well as it plays the sound sadly it spams it got a better solution then the below?
    Code:
                catch (Exception SProcess)
                {
                    
                    ErrorText.Text = "Error" + SProcess;
                    SoundPlayer simpleSound = new            SoundPlayer("http://snigelmannen.dnsdojo.org/SnigelStatus/moo3.wav");
                    simpleSound.Play(Stop);
                }
    " Spy sappin mah sentry! "

  13. #13
    ReidE96's Avatar Archer Authenticator enabled
    Reputation
    470
    Join Date
    Dec 2006
    Posts
    1,625
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What do you mean by "spams"? I'd use a soundplayer myself if I wanted to play a sound, it shouldn't repeat unless you tell it to.

  14. #14
    snigelmannen's Avatar Member
    Reputation
    27
    Join Date
    Jul 2007
    Posts
    318
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well if you can be bothered ill just put the link to the version with the error sound.

    Index of /SnigelStatus/Beta
    " Spy sappin mah sentry! "

Similar Threads

  1. Help WoW Fish-Bot
    By Eliteplague in forum World of Warcraft General
    Replies: 2
    Last Post: 12-10-2024, 05:46 PM
  2. HELP: Gold Scam Exploit
    By GoldDragon in forum World of Warcraft General
    Replies: 11
    Last Post: 01-23-2007, 07:26 PM
  3. Banner Ad Redesign help
    By Matt in forum Community Chat
    Replies: 57
    Last Post: 07-08-2006, 08:40 PM
  4. Hit points and talent points? Please help
    By hankusdankus in forum World of Warcraft General
    Replies: 6
    Last Post: 05-04-2006, 02:00 PM
  5. bot help
    By xwhitedeathx in forum World of Warcraft General
    Replies: 3
    Last Post: 05-01-2006, 03:50 AM
All times are GMT -5. The time now is 12:46 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search