Quantcast

Jump to content

» «
Photo

[HELP]Assembly Keybind Logging

22 replies to this topic
Maro Hannover
  • Maro Hannover

    Scriptboy

  • BUSTED!
  • Joined: 06 Jan 2014
  • None

#1

Posted 11 June 2014 - 08:24 AM

i Have re-installed GTA IV but now i got an issue with my mod. Here is the Scripthooknet log

014-06-10 23:00:08 - Initializing ScriptHookDotNet v1.7.1.7 BETA (on GTA IV version 1.0.7.0 with C++ Hook version 0.5.1)
2014-06-10 23:01:43 - Direct3D device created!

2014-06-10 23:01:43 - SEARCHING FOR SCRIPTS...
2014-06-10 23:01:43 - Loading scripts in Assembly 'scripts\ChoirMusic.net.dll' ...
2014-06-10 23:01:43 -  ...found script 'ChoirMusic.Choir'!
2014-06-10 23:01:43 - DONE! 1 valid scripts found!

2014-06-10 23:01:43 - STARTING SCRIPTS...
2014-06-10 23:01:43 - INFO: Phone number checks are not available!
2014-06-10 23:01:43 -  ...successfully started script 'ChoirMusic.Choir'!
2014-06-10 23:01:48 - Error during Tick in script 'ChoirMusic.Choir':
                      System.IO.FileNotFoundException: Could not load file or assembly 'NAudio, Version=1.7.0.15, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
                      File name: 'NAudio, Version=1.7.0.15, Culture=neutral, PublicKeyToken=null'
                         at ChoirMusic.Choir.tickEvent(Object sender, EventArgs e)
                         at GTA.Script.TryTick()
                         at GTA.Script.DoTick()
                         at GTA.ScriptThread.OnTick()
                      
                      WRN: Assembly binding logging is turned OFF.
                      To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
                      Note: There is some performance penalty associated with assembly bind failure logging.
                      To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
                      
2014-06-10 23:01:58 - Direct3D device lost!

Here is my Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GTA;
using NAudio;
using NAudio.WindowsMediaFormat;

namespace ChoirMusic
{
    public class Choir : GTA.Script
    {
        public Choir()
        {
            this.Interval = 5000;
            this.Tick += new EventHandler(tickEvent);
        }

           public void tickEvent(object sender, EventArgs e)
           {
            NAudio.Wave.WaveFileReader s = new NAudio.Wave.WaveFileReader(".\\Scripts\\CR\\CR.wav");
            NAudio.Wave.WaveChannel32 wc = new NAudio.Wave.WaveChannel32(new NAudio.Wave.WaveFileReader(".\\Scripts\\CR\\CR.wav"));
            NAudio.Wave.DirectSoundOut player = new NAudio.Wave.DirectSoundOut();

            if(Player.Character.Health < 25)
            {
                player.Init(wc);
                player.Play();
            }
            if (Player.Character.Health > 25)
            {
                player.Stop();
                player.Dispose();
            }
        }
    }
}

stef538
  • stef538

    It's just me, going 88 MPH.

  • Members
  • Joined: 06 Oct 2012
  • Netherlands

#2

Posted 11 June 2014 - 08:53 AM Edited by stef538, 11 June 2014 - 08:53 AM.

you need the naudio.dll file. Naudio.codeplex.com

 

Then, unzip it to a folder of your choice. Copy and paste NAudio.dll into your GTA4 root folder.

  • Wiebrendh likes this

Maro Hannover
  • Maro Hannover

    Scriptboy

  • BUSTED!
  • Joined: 06 Jan 2014
  • None

#3

Posted 11 June 2014 - 11:48 AM

you need the naudio.dll file. Naudio.codeplex.com

 

Then, unzip it to a folder of your choice. Copy and paste NAudio.dll into your GTA4 root folder.

Thank you very much Helped

  • stef538 likes this

Rugz007
  • Rugz007

    Scripters ... roll out !

  • Members
  • Joined: 19 Apr 2014
  • India

#4

Posted 11 June 2014 - 02:37 PM

I got to admit this was funny

LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#5

Posted 11 June 2014 - 05:09 PM Edited by LordOfTheBongs, 11 June 2014 - 05:13 PM.

u do realize that if your health is below 25 every 5 seconds u create new NAudio objects without disposing the objects created in the previous call to your tick method??

 

since u create a new NAudio objects every tick, then dispose it every tick or only create it once and don't dispose it. You look to be creating a memory leak.

 

If u exit the tick method without disposing the created NAudio objects then u will lose reference to those objects in memory and wont be able to dispose them... so u will have NAudio stuff sitting in memory that will never get used again.


LetsPlayOrDy
  • LetsPlayOrDy

    So fast you'll freak!

  • Members
  • Joined: 24 Aug 2013
  • United-States

#6

Posted 11 June 2014 - 05:13 PM

 

i Have re-installed GTA IV but now i got an issue with my mod. Here is the Scripthooknet log

014-06-10 23:00:08 - Initializing ScriptHookDotNet v1.7.1.7 BETA (on GTA IV version 1.0.7.0 with C++ Hook version 0.5.1)
2014-06-10 23:01:43 - Direct3D device created!

2014-06-10 23:01:43 - SEARCHING FOR SCRIPTS...
2014-06-10 23:01:43 - Loading scripts in Assembly 'scripts\ChoirMusic.net.dll' ...
2014-06-10 23:01:43 -  ...found script 'ChoirMusic.Choir'!
2014-06-10 23:01:43 - DONE! 1 valid scripts found!

2014-06-10 23:01:43 - STARTING SCRIPTS...
2014-06-10 23:01:43 - INFO: Phone number checks are not available!
2014-06-10 23:01:43 -  ...successfully started script 'ChoirMusic.Choir'!
2014-06-10 23:01:48 - Error during Tick in script 'ChoirMusic.Choir':
                      System.IO.FileNotFoundException: Could not load file or assembly 'NAudio, Version=1.7.0.15, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
                      File name: 'NAudio, Version=1.7.0.15, Culture=neutral, PublicKeyToken=null'
                         at ChoirMusic.Choir.tickEvent(Object sender, EventArgs e)
                         at GTA.Script.TryTick()
                         at GTA.Script.DoTick()
                         at GTA.ScriptThread.OnTick()
                      
                      WRN: Assembly binding logging is turned OFF.
                      To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
                      Note: There is some performance penalty associated with assembly bind failure logging.
                      To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
                      
2014-06-10 23:01:58 - Direct3D device lost!

Here is my Code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GTA;
using NAudio;
using NAudio.WindowsMediaFormat;

namespace ChoirMusic
{
    public class Choir : GTA.Script
    {
        public Choir()
        {
            this.Interval = 5000;
            this.Tick += new EventHandler(tickEvent);
        }

           public void tickEvent(object sender, EventArgs e)
           {
            NAudio.Wave.WaveFileReader s = new NAudio.Wave.WaveFileReader(".\\Scripts\\CR\\CR.wav");
            NAudio.Wave.WaveChannel32 wc = new NAudio.Wave.WaveChannel32(new NAudio.Wave.WaveFileReader(".\\Scripts\\CR\\CR.wav"));
            NAudio.Wave.DirectSoundOut player = new NAudio.Wave.DirectSoundOut();

            if(Player.Character.Health < 25)
            {
                player.Init(wc);
                player.Play();
            }
            if (Player.Character.Health > 25)
            {
                player.Stop();
                player.Dispose();
            }
        }
    }
}

 

u do realize that if your health is below 25 every 5 seconds u create new NAudio objects without disposing the previous object created in the previous call to your tick method??

 

since u create a new one every tick, then dispose it every tick or only create it once and don't dispose it. You look to be creating a memory leak.

 

If u exit the tick method without disposing the created NAudio objects then u will lose reference to those objects in memory and wont be able to dispose them... so u will have NAudio stuff sitting in memory that will never get used again.

 

 

Maybe a little more like this? 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GTA;
using NAudio;
using NAudio.WindowsMediaFormat;

namespace ChoirMusic
{
    public class Choir : GTA.Script
    {
		NAudio.Wave.WaveFileReader s;
		NAudio.Wave.WaveChannel32 wc;
		NAudio.Wave.DirectSoundOut player;
	
        public Choir()
        {
			s = new NAudio.Wave.WaveFileReader(".\\Scripts\\CR\\CR.wav");
            wc = new NAudio.Wave.WaveChannel32(new NAudio.Wave.WaveFileReader(".\\Scripts\\CR\\CR.wav"));
            player = new NAudio.Wave.DirectSoundOut();
		
            this.Interval = 5000;
            this.Tick += new EventHandler(tickEvent);
        }

           public void tickEvent(object sender, EventArgs e)
           {
            

            if(Player.Character.Health < 25)
            {
                player.Init(wc);
                player.Play();
            }
            if (Player.Character.Health > 25)
            {
                player.Stop();
                player.Dispose();
            }
        }
    }
}

Maro Hannover
  • Maro Hannover

    Scriptboy

  • BUSTED!
  • Joined: 06 Jan 2014
  • None

#7

Posted 11 June 2014 - 06:19 PM

Thank you Letsplyordy


LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#8

Posted 11 June 2014 - 06:23 PM Edited by LordOfTheBongs, 11 June 2014 - 06:24 PM.

@LetsPlayOrDy

 

Close ;)

 

Remove the line that disposes the objects since u wont be creating new ones... only play and stop ;)

 

put player.Init(wc); in the constructor too

  • Wiebrendh likes this

LetsPlayOrDy
  • LetsPlayOrDy

    So fast you'll freak!

  • Members
  • Joined: 24 Aug 2013
  • United-States

#9

Posted 11 June 2014 - 06:51 PM

I wasn't trying to make it perfect. Maro is supposed to be doing that lol
  • Wiebrendh likes this

Maro Hannover
  • Maro Hannover

    Scriptboy

  • BUSTED!
  • Joined: 06 Jan 2014
  • None

#10

Posted 12 June 2014 - 12:41 PM

I wasn't trying to make it perfect. Maro is supposed to be doing that lol

LOL.

OdE20Z0.gif

 

But What do you Mean?

 

DbnRNG3.jpg


LetsPlayOrDy
  • LetsPlayOrDy

    So fast you'll freak!

  • Members
  • Joined: 24 Aug 2013
  • United-States

#11

Posted 12 June 2014 - 12:59 PM

 

I wasn't trying to make it perfect. Maro is supposed to be doing that lol

LOL.

OdE20Z0.gif

 

But What do you Mean?

 

DbnRNG3.jpg

 

 

It wasn't THAT funny.

 

I mean you are the one who is supposed to be coding your mod, correcting errors/bugs and that such, not me, so I wasn't trying to make your code perfect.


Wiebrendh
  • Wiebrendh

    C# Programmer

  • Members
  • Joined: 22 Mar 2014
  • Netherlands

#12

Posted 12 June 2014 - 01:57 PM

 

 

I wasn't trying to make it perfect. Maro is supposed to be doing that lol

LOL.

OdE20Z0.gif

 

But What do you Mean?

 

DbnRNG3.jpg

 

 

It wasn't THAT funny.

 

I mean you are the one who is supposed to be coding your mod, correcting errors/bugs and that such, not me, so I wasn't trying to make your code perfect.

 

 

That wasn't funny at all, and Maro, just like LetsModOrDie says, people here are doing suggestions, they wont make 90% of the mod for you, you add some simple stuff, and then call it your mod


Rugz007
  • Rugz007

    Scripters ... roll out !

  • Members
  • Joined: 19 Apr 2014
  • India

#13

Posted 13 June 2014 - 02:31 AM

Weibren what did i told you -_- be -------

LetsPlayOrDy
  • LetsPlayOrDy

    So fast you'll freak!

  • Members
  • Joined: 24 Aug 2013
  • United-States

#14

Posted 13 June 2014 - 02:53 AM Edited by LetsPlayOrDy, 13 June 2014 - 02:55 AM.

Weibren what did i told you -_- be -------

 

Be what? Since you didn't write the word, I'm guessing it's a cuss word. The only words that I can think of that consist of 7 letters (you have 7 -'s) are dumb@ss and @sshole. Wiebrendh is not being either of those.

 

 

And you are kinda being one of those, if that is what you are implying.


Rugz007
  • Rugz007

    Scripters ... roll out !

  • Members
  • Joined: 19 Apr 2014
  • India

#15

Posted 13 June 2014 - 03:07 AM

nono i just not kept it for guessing he knows what i am telling him :D if you wanna guess take this "--------" -_- and see weibren is my friend and i woundnt say him anything and what do you think i am 1 of those man ? :'( 


LetsPlayOrDy
  • LetsPlayOrDy

    So fast you'll freak!

  • Members
  • Joined: 24 Aug 2013
  • United-States

#16

Posted 13 June 2014 - 03:15 AM

nono i just not kept it for guessing he knows what i am telling him :D if you wanna guess take this "--------" -_- and see weibren is my friend and i woundnt say him anything and what do you think i am 1 of those man ? :'( 

 

Butthole?

Well you're the one that is bleeping words...


Rugz007
  • Rugz007

    Scripters ... roll out !

  • Members
  • Joined: 19 Apr 2014
  • India

#17

Posted 13 June 2014 - 03:17 AM

okay you always think bad yeah? i am saying him somthing good -__________________-


LetsPlayOrDy
  • LetsPlayOrDy

    So fast you'll freak!

  • Members
  • Joined: 24 Aug 2013
  • United-States

#18

Posted 13 June 2014 - 03:23 AM

okay you always think bad yeah? i am saying him somthing good -__________________-

 

Then why does it need to be bleeped? If you live in the real world, you will see that the only things that are bleeped are bad things (cuss words and private parts on tv are 2 examples).


Rugz007
  • Rugz007

    Scripters ... roll out !

  • Members
  • Joined: 19 Apr 2014
  • India

#19

Posted 13 June 2014 - 03:25 AM

ok i understand now :D 


stef538
  • stef538

    It's just me, going 88 MPH.

  • Members
  • Joined: 06 Oct 2012
  • Netherlands

#20

Posted 13 June 2014 - 09:00 AM

this is just weird.


Rugz007
  • Rugz007

    Scripters ... roll out !

  • Members
  • Joined: 19 Apr 2014
  • India

#21

Posted 13 June 2014 - 09:02 AM

yep :/


Maro Hannover
  • Maro Hannover

    Scriptboy

  • BUSTED!
  • Joined: 06 Jan 2014
  • None

#22

Posted 13 June 2014 - 11:20 AM

What is Wierd.?

GTA-4-Nicolauncher.jpg


stef538
  • stef538

    It's just me, going 88 MPH.

  • Members
  • Joined: 06 Oct 2012
  • Netherlands

#23

Posted 13 June 2014 - 11:39 AM

How Rugz007 responds with the ..... just say it, or say nothing.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users