small shell script for Linux users

Post anything to do with editing Nexuiz here. Whether its problems you've had, questions, or if you just want to show off your work.

Moderators: Nexuiz Moderators, Moderators

Wed Apr 05, 2006 4:51 pm

  • For you how don't understand it put it in a file .sh
    chmod 777 the file.
    Type ./the file name server ip.
    it will auto record a demo name of the demo will be
    you're nickname ( or what ever you put in the script )_the time stamp
    Its shot its simple and is handy for ladder matches

    #change the nickname
    nickname="change me";
    #do noting here
    date=$(date +"%Y%m%d%H%M");
    ./nexuiz-linux-686-sdl -sndstereo +record $nickname_$date +connect $1


    don't know if it already hase been made or posted here
    Crashzor
    Member
     
    Posts: 15
    Joined: Sat Apr 01, 2006 8:24 pm

Wed Apr 05, 2006 4:59 pm

Wed Apr 05, 2006 5:03 pm

  • o you're right about the chmod and i just notice the pm.
    sorry litler error you can remove this thread :lol:
    Crashzor
    Member
     
    Posts: 15
    Joined: Sat Apr 01, 2006 8:24 pm

Wed Apr 05, 2006 5:07 pm

Wed Apr 05, 2006 6:29 pm

  • btw: Nexuiz 1.6 will have automatic demo recording as engine feature (the cvars are cl_autodemo and cl_autodemo_nameformat) :)
    User avatar
    KadaverJack
    Site admin and forum addon
     
    Posts: 1102
    Joined: Tue Feb 28, 2006 9:42 pm

Wed Apr 05, 2006 7:20 pm

Wed Apr 05, 2006 7:35 pm

  • esteel wrote:does this also mean in-game record-starting does work??

    No. But the enigne autorecording has the advantage, that you can switch servers and it will start a new demo automagically.
    User avatar
    KadaverJack
    Site admin and forum addon
     
    Posts: 1102
    Joined: Tue Feb 28, 2006 9:42 pm

Thu Apr 06, 2006 8:41 am

Fri Apr 07, 2006 1:14 am

  • esteel wrote:Yeah thats true. Hmm guess i'll change my record script to set the cl_autodemo variable to 1 when 1.6 is out because there is no need to record really every game..

    I would prefer an "Autorecord On/Off" switch in the menu instead of a shell script. A good place for it would be in the join menu, next to the refresh button imho.
    User avatar
    KadaverJack
    Site admin and forum addon
     
    Posts: 1102
    Joined: Tue Feb 28, 2006 9:42 pm


  • Crashzor wrote:For you how don't understand it put it in a file .sh
    chmod 777 the file.


    I don't want to be a nitpick, but: don't even get used to chmodding files 777.

    If you own the file, all that matters is that you can do everything with it - that is, 700 suffices. Useful chmod values are:

    • 600 - you can read/write, nobody else can do anything
    • 640 - you can read/write, your group can read
    • 644 - you can read/write, everyone can read
    • 660 - you and your group can read/write, nobody else can do anything
    • 664 - you and your group can read/write, everyone can read
    • 666 - everyone can read and write


    Additionally, shell scripts and programs need to be marked as executable so that the OS knows it is a script/program. This is basically done by replacing all fours by fives and all sixes by sevens. The access rights in the list would then be: 700, 750, 755, 770, 775, 777.

    Usually, you don't want to give more access rights than 644 for regular files and 755 for directories and programs/scripts. These rights mean "everyone can read/execute/enter, nobody except you can write".

    Of course, all this does not matter if you are the only one who uses the computer - but if you use "wrong" chmod values in a multi-user system like at university or on hoster where you can run a dedicated server, you can get severely screwed, that is, "owned" by others who access the same computer.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Fri Apr 07, 2006 9:08 am

  • the numeric chomd's are grt for speedy typing, but kinda hard to remeber sometimes. there is an alternate way of setting rights, literal.

    for example if you whant exec, read and write group meneber read and other nada you would do "chmod u=rwx,g=r mycoolscript.sh"

    Specing "who"
    u = user
    g = group
    o = other
    a = all (same as ugo)

    Specing "what"
    r = read
    w = write
    x = exec

    the "who" part can be combined just like the "what" part. ex:
    "chmod ug=rw,o=r"

    some examples

    chmod 777 is chmod a=rwx
    chmod 700 is chmod u=rwx
    chmod 744 is chmod u=rwx,go=r
    HOF:
    <Diablo> the nex is a "game modification"
    <Diablo> quake1 never had a weapon like that.
    <Vordreller> there was no need for anything over 4GB untill Vista came along
    <Samua>]Idea: Fix it? :D
    <Samua>Lies, that only applies to other people.
    User avatar
    tZork
    tZite Admin
     
    Posts: 1337
    Joined: Tue Feb 28, 2006 6:16 pm
    Location: Halfway to somwhere else

Fri Apr 07, 2006 12:56 pm

  • tZork wrote:the numeric chomd's are grt for speedy typing, but kinda hard to remeber sometimes. there is an alternate way of setting rights, literal.


    Well, that's why I only mentioned the combinations of octal rights that actually make sense... many combinations don't.

    some examples

    chmod 777 is chmod a=rwx
    chmod 700 is chmod u=rwx
    chmod 744 is chmod u=rwx,go=r


    The most useful part about this syntax is that you can also MODIFY rights:

    chmod a+r *.c # make everyone be able to read the .c files

    Or even:

    chmod -R a=rX,u+w .

    The latter makes this directory and below 755, all things that already were executable 755, and all other regular files 644.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Fri Apr 07, 2006 5:57 pm

  • KadaverJack wrote:I would prefer an "Autorecord On/Off" switch in the menu instead of a shell script. A good place for it would be in the join menu, next to the refresh button imho.

    I like both options. To have it in some batch file does not change anything for me.. its harder to forget and as i mostly use ST-2 as server browser i see the join menu not very often :)
    User avatar
    esteel
    Site admin and forum addon
     
    Posts: 3924
    Joined: Wed Mar 01, 2006 8:27 am



Return to Nexuiz - Editing




Information
  • Who is online
  • Users browsing this forum: No registered users and 1 guest