aMule Forum

English => Multiplatform => Mac OSX => Topic started by: djumbolo on January 18, 2006, 06:53:10 PM

Title: Amule with scripts
Post by: djumbolo on January 18, 2006, 06:53:10 PM
Hi
Under Tiger can I command A mule :
start
stop
view files downloading
add files o download ....

Thanks
Title: Re: Amule with scripts
Post by: lionel77 on January 19, 2006, 01:08:22 AM
I'm not sure I fully understand what you are saying or asking but if you want to control aMule using scripts, amulecmd is a really handy tool. Since version 2.1.0 we are including amulecmd with our binaries. It's in "aMule.app/Contents/MacOS/".

For example, the following 'aspeed' script allows me to control aMule's upstream bandwidth, which is particularly when I want to access my machine remotely via vnc. Before I connect via vnc I do a "aspeed 20" over ssh to reduce aMule's upload speed to 20k/s. Very handy. :)
Code: [Select]
#!/bin/sh
/Volumes/IncomingHD/-amule/aMule.app/Contents/MacOS/amulecmd -c "Set BWLimit Up $1"

To get an idea of all of amulecmd's features, just start it via "/PathToaMule/aMule.app/Contents/MacOS/amulecmd" in the Terminal (you need to set up remote connections before in aMule) and type "help":
Code: [Select]
aMulecmd$ help
Available commands:
Add           Adds an ed2k link to core.
Cancel        Cancel download.
Connect       Connect to the network.
Disconnect    Disconnect from the network.
Exit          Exits from the application.
Get           Get and display a preference value.
Help          Show help.
Pause         Pause download.
Quit          Exits from the application.
Reload        Reloads the given object.
Resume        Resume download.
Set           Set a preference value.
Show          Show queues/lists.
Shutdown      Shutdown aMule.
Statistics    Show full statistics tree.
Status        Show short status information.
Title: Re: Amule with scripts
Post by: djumbolo on January 21, 2006, 03:31:50 PM
Very nice
I did not know that amulecmd was include in Amule version Mac OS X
Thaks a lot
Title: Re: Amule with scripts
Post by: djumbolo on January 21, 2006, 03:53:07 PM
An other PB

when I Script

#!/bin/sh
/Volumes/IncomingHD/-amule/aMule.app/Contents/MacOS/amulecmd -c "Set BWLimit Up $1"
==>
Enter password for mule connection:

How I include my pwd in the script

Thanks
Title: Re: Amule with scripts
Post by: lionel77 on January 21, 2006, 11:49:43 PM
Quote
Originally posted by djumbolo
How I include my pwd in the script
There are two options:
[list=1]
/Path/to/aMule/aMule.app/Contents/MacOS/amulecmd -P "myPassword" -c "Some command".
/Path/to/aMule/aMule.app/Contents/MacOS/amulecmd --create-config-from="/Users/myUser/Library/Application Support/aMule/amule.conf".
The advantage of this option is that you have to do it only once and from there on amulecmd automatically retrieves the password from the remote.conf file.
[/list=1]

:)
Title: Re: Amule with scripts
Post by: djumbolo on January 22, 2006, 11:10:33 AM
Very good
I will test that immediately


On the other hand I have several crash landing of "Amule" when I use "amulecmd"

thanks
Title: Re: Amule with scripts
Post by: lionel77 on January 22, 2006, 05:18:11 PM
Quote
Originally posted by djumbolo
On the other hand I have several crash landing of "Amule" when I use "amulecmd".
Interesting, I didn't have any amulecmd induced crashes so far.

It would be great if you could grab one of my debug cvs builds of aMule (see the URL in my sig) and try if you can get it to crash with the included amulecmd. If you then post a backtrace (i posted detailed instructions on how to do this in this thread (http://forum.amule.org/thread.php?threadid=7670)) we will be able to fix the cause of the crash. :)
Title: Re: Amule with scripts
Post by: pick on January 24, 2006, 04:16:15 PM
http://forum.amule.org/thread.php?threadid=8750&sid=
;)

And, in effect, amulcmd crash aMule 2.10 mac. No pb with linux version...
Title: Re: Amule with scripts
Post by: lionel77 on January 25, 2006, 06:26:57 PM
Pick, could you try to crash an aMule debug binary with amulecmd and then post the backtrace here on the forum? Then somebody could try to fix the crash. :)
Title: Re: Amule with scripts
Post by: pick on January 29, 2006, 03:44:30 PM
I think my mule crashed cause to amulecmd flooding. My widget launch a new amulecmd request every 2 secs. I'm working on it.
Title: Re: Amule with scripts
Post by: lionel77 on January 29, 2006, 07:28:49 PM
Heh, ok, that would explain it. :)