aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Amule with scripts  (Read 5234 times)

djumbolo

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 9
Amule with scripts
« 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
Logged

lionel77

  • Provider of Mac builds, Forum Mod
  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 1107
  • Mac OS X 10.4 (Power Mac G5)
Re: Amule with scripts
« Reply #1 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.
Logged
Current aMule CVS builds for OS X can be found here.

djumbolo

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 9
Re: Amule with scripts
« Reply #2 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
Logged

djumbolo

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 9
Re: Amule with scripts
« Reply #3 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
Logged

lionel77

  • Provider of Mac builds, Forum Mod
  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 1107
  • Mac OS X 10.4 (Power Mac G5)
Re: Amule with scripts
« Reply #4 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]
  • Use the -P switch to include the password every time you invoke amulecmd. So start amulecmd for instance with
/Path/to/aMule/aMule.app/Contents/MacOS/amulecmd -P "myPassword" -c "Some command".
  • The more elegant way is to create a remote.conf file for amulecmd. You do this with
/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]

:)
Logged
Current aMule CVS builds for OS X can be found here.

djumbolo

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 9
Re: Amule with scripts
« Reply #5 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
Logged

lionel77

  • Provider of Mac builds, Forum Mod
  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 1107
  • Mac OS X 10.4 (Power Mac G5)
Re: Amule with scripts
« Reply #6 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) we will be able to fix the cause of the crash. :)
Logged
Current aMule CVS builds for OS X can be found here.

pick

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 36
    • http://www.pickzik.com
Re: Amule with scripts
« Reply #7 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...
Logged

lionel77

  • Provider of Mac builds, Forum Mod
  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 1107
  • Mac OS X 10.4 (Power Mac G5)
Re: Amule with scripts
« Reply #8 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. :)
Logged
Current aMule CVS builds for OS X can be found here.

pick

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 36
    • http://www.pickzik.com
Re: Amule with scripts
« Reply #9 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.
Logged

lionel77

  • Provider of Mac builds, Forum Mod
  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 1107
  • Mac OS X 10.4 (Power Mac G5)
Re: Amule with scripts
« Reply #10 on: January 29, 2006, 07:28:49 PM »

Heh, ok, that would explain it. :)
Logged
Current aMule CVS builds for OS X can be found here.