<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://test.amule.szerverem.hu/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://test.amule.szerverem.hu/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=85.177.224.183</id>
		<title>AMule Project FAQ - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://test.amule.szerverem.hu/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=85.177.224.183"/>
		<link rel="alternate" type="text/html" href="http://test.amule.szerverem.hu/wiki/Special:Contributions/85.177.224.183"/>
		<updated>2026-04-05T22:26:30Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.23.3</generator>

	<entry>
		<id>http://test.amule.szerverem.hu/wiki/Events</id>
		<title>Events</title>
		<link rel="alternate" type="text/html" href="http://test.amule.szerverem.hu/wiki/Events"/>
				<updated>2007-04-25T05:08:47Z</updated>
		
		<summary type="html">&lt;p&gt;85.177.224.183: %FILE and %NAME where wrong defined&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;center&amp;gt;&lt;br /&gt;
'''English''' | [[events-de|German]] | [[events-nds|Low-Saxon]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Events''' are actions aMule can take upon when certain things happen. These actions are configured on the [[Usage_Preferences#Events|Events]] tab of the [[Usage_Preferences]] notebook or, if you are running amuled, in the [UserEvents] section of [[amule.conf]].&lt;br /&gt;
&lt;br /&gt;
There are two kinds of Events supported at the moment:&lt;br /&gt;
* Download completed&lt;br /&gt;
* New chat session&lt;br /&gt;
* Out of space&lt;br /&gt;
* Error on completion&lt;br /&gt;
&lt;br /&gt;
When one of these events is triggered, you can configure aMule to execute a&lt;br /&gt;
* core command&lt;br /&gt;
* GUI command&lt;br /&gt;
&lt;br /&gt;
A core command is a command that will be executed by a flavor of aMule that has a core (aMule daemon or aMule monolithic). A GUI command is a command that will be executed by a flavor of aMule that has GUI (aMule GUI or aMule monolithic). Notice that if you specify both, aMule monolithic will execute both.&lt;br /&gt;
&lt;br /&gt;
=== Download completed ===&lt;br /&gt;
&lt;br /&gt;
When aMule completes a download, a Download completed event is triggered. The following variables can be accessed:&lt;br /&gt;
* %FILE - the name of the downloaded file with full path&lt;br /&gt;
* %NAME - the name of the downloaded file without path&lt;br /&gt;
* %HASH - the ed2k hash of the downloaded file&lt;br /&gt;
* %SIZE - the size in bytes of the downloaded file&lt;br /&gt;
* %DLACTIVETIME - the total time the download was active&lt;br /&gt;
&lt;br /&gt;
=== New chat session ===&lt;br /&gt;
&lt;br /&gt;
When someone initiates a chat session with you, the New chat session event is triggered. When this happens, the following variable can be accessed:&lt;br /&gt;
* %Sender - username of the person initiating the chat&lt;br /&gt;
&lt;br /&gt;
=== Out of space ===&lt;br /&gt;
&lt;br /&gt;
When aMule runs out of diskspace on the partition which it uses for its temporary files, the Out of space event is triggered. When this happens, the following variable can be accessed:&lt;br /&gt;
* %PARTITION&lt;br /&gt;
&lt;br /&gt;
=== Error on completion ===&lt;br /&gt;
&lt;br /&gt;
When aMule is unable to move a file from the &amp;quot;temporary&amp;quot; directory to the &amp;quot;incoming&amp;quot; directory, an Error on completion event is triggered. This is typically caused by lack of diskspace on the partition where the incoming directory is located. When this happens, the following variable can be accessed:&lt;br /&gt;
* %FILE&lt;br /&gt;
&lt;br /&gt;
=== Syntax ===&lt;br /&gt;
&lt;br /&gt;
Event commands can be either a single or compound shell command, or a shell script. In the Core command field, enter the command or script name followed by the optional parameters like this:&lt;br /&gt;
&lt;br /&gt;
:MyScript.sh %NAME %FILE %HASH %SIZE &amp;quot;%DLACTIVETIME&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Note:''' If the filename contains spaces, the variable names should be enclosed in quotes like this:&lt;br /&gt;
&lt;br /&gt;
:MyScript.sh &amp;quot;%NAME&amp;quot; &amp;quot;%FILE&amp;quot; %HASH %SIZE &amp;quot;%DLACTIVETIME&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Your shell script can obtain the values in the parameters the customary way, ie, by evaluating $1, $2, $3, etc.&lt;br /&gt;
&lt;br /&gt;
You need to make sure your script is in your PATH or that you supply the full pathname.&lt;br /&gt;
&lt;br /&gt;
=== Errors ===&lt;br /&gt;
&lt;br /&gt;
If your script fails to execute for any reason, this will be logged in aMule's [[logfile]]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
A simple command might look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo &amp;quot;aMule error: %PARTITION is full.&amp;quot; | mail -s Warning mymail@domain.tld&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This inserts the variable %PARTITION in the text of a one-line email message and sends it to the email address specfied.&lt;br /&gt;
&lt;br /&gt;
For more elaborate purposes, you will will want to call an external script. &lt;br /&gt;
&lt;br /&gt;
Here the bash script by '''Ezeltje''' from [http://forum.amule.org/thread.php?threadid=11695 aMule-Forum] which will send you an email every time a download is completed. To use it, enter your email address where indicated and save it to a location in your PATH. Then add this line: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
doneDL.sh &amp;quot;%NAME&amp;quot; &amp;quot;%FILE&amp;quot; %HASH %SIZE &amp;quot;%DLACTIVETIME&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to the Core command field of the Download completed section of the Events page. It will now be invoked everytime aMule finishes a download.&lt;br /&gt;
&lt;br /&gt;
  #!/bin/bash&lt;br /&gt;
  #&lt;br /&gt;
  # doneDL.sh - sends an email upon completion of an aMule download&lt;br /&gt;
  # Used in conjuction with aMule's Event feature&lt;br /&gt;
  #&lt;br /&gt;
  # Call like this: doneDL.sh &amp;quot;%NAME&amp;quot; &amp;quot;%FILE&amp;quot; %HASH %SIZE &amp;quot;%DLACTIVETIME&amp;quot;&lt;br /&gt;
  #&lt;br /&gt;
  # Enter your email address here:&lt;br /&gt;
  eMail=&lt;br /&gt;
  #&lt;br /&gt;
  NameShort=$1&lt;br /&gt;
  NameLong=$2&lt;br /&gt;
  Hash=$3&lt;br /&gt;
  Size=$4&lt;br /&gt;
  DLtime=$5&lt;br /&gt;
  {&lt;br /&gt;
  echo aMule completed this download:&lt;br /&gt;
  echo ------------------------------&lt;br /&gt;
  echo&lt;br /&gt;
  echo File: &amp;quot;$NameLong&amp;quot;&lt;br /&gt;
  echo Hash: $Hash&lt;br /&gt;
  echo -n &amp;quot;Time: &amp;quot;&lt;br /&gt;
  date | awk '{print $4 &amp;quot; &amp;quot; $5}'&lt;br /&gt;
  echo -n Size: $Size bytes &lt;br /&gt;
  if [ $Size -gt 102400 ] ; then echo &amp;quot; (&amp;quot;$(($(($Size / 1024)) / 1024)) &amp;quot;Mb)&amp;quot; ; fi&lt;br /&gt;
  if [ ! -z &amp;quot;$DLtime&amp;quot; ] ; then echo &amp;quot;Active download time:&amp;quot; $DLtime ; fi&lt;br /&gt;
  echo&lt;br /&gt;
  echo --------------------------------------------------------------------&lt;br /&gt;
  cas&lt;br /&gt;
  echo -n &amp;quot;Resident memory: &amp;quot;&lt;br /&gt;
  echo $(ps u -C amule --no-headers | awk '{print $6}') kB&lt;br /&gt;
  echo -n &amp;quot;Virtual memory:  &amp;quot;&lt;br /&gt;
  echo $(ps u -C amule --no-headers | awk '{print $5}') kB&lt;br /&gt;
  echo --------------------------------------------------------------------&lt;br /&gt;
  } | mail -s &amp;quot;$NameShort&amp;quot; $eMail&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>85.177.224.183</name></author>	</entry>

	</feed>