Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script: Crosshair Switcher by Verse
#1
This script allows you to set a crosshair size and type for every weapon from knife to akimbo. When you swap to a different weapon in game the crosshair will change too. I'll do further documentation when I have more time. Please try it out, customize it and other wise improve it. Oh, and let me know what you think.

CURRENT VERSION: 0.31



Version 0.01
Code:
//Crosshair Switcher by Verse ver 0.01 beta
bind "MOUSE1" [
        attack
        setCrosshair
    ]
bind "MOUSE2" [ if $editing [ showmenu editing ] [ grenadesCustCrosshair ] ]
bind "MOUSE4" [ if $editing [universaldelta  1] [cycleUpCustCrosshair]]
bind "MOUSE5" [ if $editing [universaldelta -1] [cycleDownCustCrosshair]]

alias cycleUpCustCrosshair [
    shiftweapon 1
    setCrosshair
]

alias cycleDownCustCrosshair [
    shiftweapon -1
    setCrosshair
]

alias primaryCustCrosshair [
    setWeapon (currentprimary)
    setCrosshair
]

alias meleeCustCrosshair [
    setWeapon 0
    setCrosshair
]

alias secondaryCustCrosshair [
    setWeapon 1
    setCrosshair
]

alias grenadesCustCrosshair [
    setWeapon 8
    setCrosshair
    
    
    if (= (curweapon) 8) [
        attack
        onrelease [
            setWeapon (prevweapon)
        ]
        alias count 600
        while [ (< $count 2051) ] [
            alias i 600
            sleep $count [
                setCrosshair
            ]
            alias count (+ $count 50)
        ]
    ]
]

alias setWeapon [
    num = $arg1
    
//    Knife    0
    if (= $num 0) [
        melee
    ]
//    Pist    1
    if (= $num 1) [
        secondary
    ]
//    Cbine    2
    if (= $num 2) [
        primary
    ]
//    Shot    3
    if (= $num 3) [
        primary
    ]
//    subM    4
    if (= $num 4) [
        primary
    ]
//    snipe    5
    if (= $num 5) [
        primary
    ]
//    AR        6
    if (= $num 6) [
        primary
    ]
//    nade    8
    if (= $num 8) [
        grenades
    ]
//    akimbo    9
    if (= $num 9) [
        secondary
    ]
]

alias setCrosshair [
    sleep 300 [
        //size
        size = 15
        crosshairType = 0
        if
        //Knife    0
        if (= 0 (curweapon)) [
            size = 50
            crosshairType = 0
        ]
        //Pist    1
            if (= 1 (curweapon)) [
            size = 30
            crosshairType = 1
        ]
        //Cbine    2
        if (= 2 (curweapon)) [
            size = 12
            crosshairType = 3
        ]
        //Shot    3
        if (= 3 (curweapon)) [
            size = 50
            crosshairType = 5
        ]
        //subM    4
        if (= 4 (curweapon)) [
            size = 20
            crosshairType = 3
        ]
        //snipe    5
    //    if (= 5 (curweapon)) [
    //        size = 50
    //        crosshairType = 0
    //    ]
        //AR        6
        if (= 6 (curweapon)) [
            size = 12
            crosshairType = 3
        ]
        //nade    8
        if (= 8 (curweapon)) [
            size = 50
            crosshairType = 5
        ]
        //akimbo    9
        if (= 9 (curweapon)) [
            size = 30
            crosshairType = 1
        ]
        
        //Set CrosshairType
        if ( = $crosshairType 0) [
            str = cube.png
        ]
        if ( = $crosshairType 1) [
            str = default.png
        ]
        if ( = $crosshairType 2) [
            str = dot.png
        ]
        if ( = $crosshairType 3) [
            str = dot_wide.png
        ]
        if ( = $crosshairType 4) [
            str = o.png
        ]
        if ( = $crosshairType 5) [
            str = o_dot.png
        ]
        if ( = $crosshairType 6) [
            str = o_x.png
        ]
        if ( = $crosshairType 7) [
            str = red_dot.png
        ]
        if ( = $crosshairType 8) [
            str = star.png
        ]
        if ( = $crosshairType 9) [
            str = wide.png
        ]
        if ( = $crosshairType 10) [
            str = x-dot.png
        ]
        if ( = $crosshairType 11) [
            str = custom
        ]
        loadcrosshair $str
        crosshairsize $size
    ]
]
//END Crosshair Switcher by Verse

I should also mention that RR has a crosshair switcher which is smaller, and thus probably more efficient.
edit: added version number and this is a the beta version
[Image: 942178_10202211084025654_201418072_n.jpg]

Reply
#2
Time for version 0.20
Code:
//Crosshair Switcher by Verse version 0.20
//This Script has two parts
//The first implements methods to let you use the script.
//The second is the script its self.  It allows you to
//set the type and size of each weapons' crosshair.  You
//will want to cusumize the section labled "BINDS" and the
//section SETCROSSHAIR to fit your needs

//BINDS
//This script is designed to use these binds.  Customize
//these binds to fit your needs.  To use the script you must
//remove the "//" from before the line you would like to use.
    //MOUSE1 is exicuted on left-click
//    bind "MOUSE1" [ mouse1Click ]
    //MOUSE2 is exicuted on right-click
//    bind "MOUSE2" [ mouse2Click ]
    //MOUSE4 is exicuted by scrolling up on the mouse
    //scroll wheel
//    bind "MOUSE4" [ mouse4ScrollUp]
    //MOUSE5 is exicuted by scrolling down on the mouse
    //scroll wheel
//    bind "MOUSE5" [ mouse5ScrollDown]
    //The following binds are usually 1, 2, and 4
    //respectivly.  I prefer A, Z and Q as they are more
    //effective for me.
//    bind "A" [primaryCustCrosshair]
//    bind "Z" [secondaryCustCrosshair]
//    bind "Q" [meleeCustCrosshair]


alias mouse1Click [
    attack
    setCrosshair
]
alias mouse2Click [
    if $editing [
        showmenu editing
    ] [ //else
        altaction
        sleepSetCrosshair
    ]
]
alias mouse4ScrollUp [
    universaldelta  1
    sleepSetCrosshair
]
alias mouse5ScrollDown [
    universaldelta -1
    sleepSetCrosshair
]

//cycle up and down custom crosshair obsolete
alias cycleUpCustCrosshair [
    shiftweapon 1
    sleepSetCrosshair
]

alias cycleDownCustCrosshair [
    shiftweapon -1
    sleepSetCrosshair
]
//end obsolete
//END BINDS


//DIRECT SELECT
//These allow direct selection of primary weapon, pistol,
//knife, and grenades weapons in game

alias primaryCustCrosshair [
    setWeapon (currentprimary)
    sleepSetCrosshair
]

alias meleeCustCrosshair [
    setWeapon 0
    sleepSetCrosshair
]

alias secondaryCustCrosshair [
    setWeapon 1
    sleepSetCrosshair
]

alias grenadesCustCrosshair [
    setWeapon 8
    sleepSetCrosshair
    if (= (curweapon) 8) [
        attack
        onrelease [
            setWeapon (prevweapon)
        ]
        alias count 600
        while [ (< $count 2051) ] [
            alias i 600
            sleep $count [
                setCrosshair
            ]
            alias count (+ $count 50)
        ]
    ]
]

//This codeblock is used by DIRECT SELECT
alias setWeapon [
    num = $arg1
    
//    Knife    0
    if (= $num 0) [
        melee
    ]
//    Pist    1
    if (= $num 1) [
        secondary
    ]
//    Cbine    2
    if (= $num 2) [
        primary
    ]
//    Shot    3
    if (= $num 3) [
        primary
    ]
//    subM    4
    if (= $num 4) [
        primary
    ]
//    snipe    5
    if (= $num 5) [
        primary
    ]
//    AR        6
    if (= $num 6) [
        primary
    ]
//    nade    8
    if (= $num 8) [
        grenades
    ]
//    akimbo    9
    if (= $num 9) [
        secondary
    ]
]
//END DIRECT SELECT

//SETCROSSHAIR
//This code block allows you to customize the size and shape
//of every crosshair for every weapon.  See instructions
//below under "Set CrosshairType"

alias sleepSetCrosshair [
    sleep 300 [setCrosshair]
]

alias setCrosshair [
    //size
    size = 15
    crosshairType = 0
    if
    //Knife    0
    if (= 0 (curweapon)) [
        size = 50
        crosshairType = 6
    ]
    //Pist    1
    if (= 1 (curweapon)) [
    size = 30
    crosshairType = 3
    ]
    //Cbine    2
    if (= 2 (curweapon)) [
        size = 12
        crosshairType = 3
    ]
    //Shot    3
    if (= 3 (curweapon)) [
        size = 50
        crosshairType = 5
    ]
    //subM    4
    if (= 4 (curweapon)) [
        size = 20
        crosshairType = 3
    ]
    //snipe    5
//    if (= 5 (curweapon)) [
//        size = 50
//        crosshairType = 0
//    ]
    //AR        6
    if (= 6 (curweapon)) [
        size = 12
        crosshairType = 3
    ]
    //nade    8
    if (= 8 (curweapon)) [
        size = 30
        crosshairType = 3
    ]
    //akimbo    9
    if (= 9 (curweapon)) [
        size = 30
        crosshairType = 3
    ]
    
//Set CrosshairType
//This is where you can pick the type of crosshair you want
//look at the number next to "$crosshairType".  For example
//if you want a the crosshair with that is a circle with a
//dot in the middle you want "crosshairType 5": o_dot.png.
//Now that you know what type you want, scroll up and set
//weapon's crosshairType to 5.
    if ( = $crosshairType 0) [
        str = cube.png
    ]
    if ( = $crosshairType 1) [
        str = default.png
    ]
    if ( = $crosshairType 2) [
        str = dot.png
    ]
    if ( = $crosshairType 3) [
        str = dot_wide.png
    ]
    if ( = $crosshairType 4) [
        str = o.png
    ]
    if ( = $crosshairType 5) [
        str = o_dot.png
    ]
    if ( = $crosshairType 6) [
        str = o_x.png
    ]
    if ( = $crosshairType 7) [
        str = red_dot.png
    ]
    if ( = $crosshairType 8) [
        str = star.png
    ]
    if ( = $crosshairType 9) [
        str = wide.png
    ]
    if ( = $crosshairType 10) [
        str = x-dot.png
    ]
    if ( = $crosshairType 11) [
        str = custom
    ]
    loadcrosshair $str
    crosshairsize $size

]
//END Crosshair Switcher by Verse
[Image: 942178_10202211084025654_201418072_n.jpg]

Reply
#3
Ok time for version 0.22
Removed some obsolete script
Added middle click ability
Made some overall efficiency modifications.
Found a bug, fixed it, and renamed 0.22.1
Code:
//Crosshair Switcher by Verse version 0.22.1
//This Script has two parts
//The first implements methods to let you use the script.
//The second is the script its self.  It allows you to
//set the type and size of each weapons' crosshair.  You
//will want to cusumize the section labled "BINDS" and the
//section SETCROSSHAIR to fit your needs

//BINDS
//This script is designed to use these binds.  Customize
//these binds to fit your needs.  To use the script you must
//remove the "//" from before the line you would like to use
    //MOUSE1 is exicuted on left-click
    bind "MOUSE1" [ mouse1Click ]
    //MOUSE2 is exicuted on right-click
    bind "MOUSE2" [ mouse2Click ]
    //MOUSE3 is exicuted on middle click
    bind "MOUSE3" [ mouse3Click ]
    //MOUSE4 is exicuted by scrolling up on the mouse
    //scroll wheel
    bind "MOUSE4" [ mouse4ScrollUp]
    //MOUSE5 is exicuted by scrolling down on the mouse
    //scroll wheel
    bind "MOUSE5" [ mouse5ScrollDown]
    //The following binds are usually 1, 2, and 4
    //respectivly.  I prefer A, Z and Q as they are more
    //effective for me.
//    bind "A" [primaryCustCrosshair]
//    bind "Z" [secondaryCustCrosshair]
//    bind "3" [ grenadesCustCrosshair ]
//    bind "Q" [meleeCustCrosshair]


alias mouse1Click [
    attack    
    resetAfterEvent
]
alias mouse2Click [
    if $editing [
        showmenu editing
    ] [
        altaction
        resetAfterEvent
    ]
]
alias mouse3Click [
    weapon    
    sleepSetCrosshair
]
alias mouse4ScrollUp [
    universaldelta  1
    sleepSetCrosshair
]
alias mouse5ScrollDown [
    universaldelta -1
    sleepSetCrosshair
]
//END BINDS


//DIRECT SELECT
//These allow direct selection of primary weapon, pistol,
//knife, and grenades weapons in game

alias primaryCustCrosshair [
    setWeapon (currentprimary)
    sleepSetCrosshair
]

alias meleeCustCrosshair [
    setWeapon 0
    sleepSetCrosshair
]

alias secondaryCustCrosshair [
    setWeapon 1
    sleepSetCrosshair
]

alias grenadesCustCrosshair [
    setWeapon 8
    resetAfterEvent
]

alias resetAfterEvent [
    alias count 0
    while [ (< $count 2051) ] [
        alias i 0
        sleep $count [
            setCrosshair
        ]
        alias count (+ $count 50)
    ]
]

//This codeblock is used by DIRECT SELECT
alias setWeapon [
    num = $arg1
    
//    Knife    0
    if (= $num 0) [
        melee
    ] [
//    Pist    1
    if (= $num 1) [
        secondary
    ] [
//    Cbine    2
    if (= $num 2) [
        primary
    ] [
//    Shot    3
    if (= $num 3) [
        primary
    ] [
//    subM    4
    if (= $num 4) [
        primary
    ] [
//    snipe    5
    if (= $num 5) [
        primary
    ] [
//    AR        6
    if (= $num 6) [
        primary
    ] [
//    nade    8
    if (= $num 8) [
        grenades
    ] [
//    akimbo    9
    if (= $num 9) [
        secondary
    ] [ ] ] ] ] ] ] ] ] ]
]
//END DIRECT SELECT

//SETCROSSHAIR
//This code block allows you to customize the size and shape
//of every crosshair for every weapon.  See instructions
//below under "Set CrosshairType"

alias sleepSetCrosshair [
    sleep 300 [setCrosshair]
]

alias setCrosshair [
    //size
    size = 15
    crosshairType = 0
    if
    //Knife    0
    if (= 0 (curweapon)) [
        size = 50
        crosshairType = 6
    ] [
    //Pist    1
    if (= 1 (curweapon)) [
    size = 30
    crosshairType = 3
    ] [
    //Cbine    2
    if (= 2 (curweapon)) [
        size = 12
        crosshairType = 3
    ] [
    //Shot    3
    if (= 3 (curweapon)) [
        size = 50
        crosshairType = 5
    ] [
    //subM    4
    if (= 4 (curweapon)) [
        size = 20
        crosshairType = 3
    ] [
    //snipe    5
    if (= 5 (curweapon)) [
        size = 50
        crosshairType = 0
    ] [
    //AR        6
    if (= 6 (curweapon)) [
        size = 12
        crosshairType = 3
    ] [
    //nade    8
    if (= 8 (curweapon)) [
        size = 30
        crosshairType = 3
    ] [
    //akimbo    9
    if (= 9 (curweapon)) [
        size = 30
        crosshairType = 3
    ] [ ] ] ] ] ] ] ] ] ]
    
//Set CrosshairType
//This is where you can pick the type of crosshair you want
//look at the number next to "$crosshairType".  For example
//if you want a the crosshair with that is a circle with a
//dot in the middle you want "crosshairType 5": o_dot.png.
//Now that you know what type you want, scroll up and set
//weapon's crosshairType to 5.
    if ( = $crosshairType 0) [
        str = cube.png
    ] [
    if ( = $crosshairType 1) [
        str = default.png
    ] [
    if ( = $crosshairType 2) [
        str = dot.png
    ] [
    if ( = $crosshairType 3) [
        str = dot_wide.png
    ] [
    if ( = $crosshairType 4) [
        str = o.png
    ] [
    if ( = $crosshairType 5) [
        str = o_dot.png
    ] [
    if ( = $crosshairType 6) [
        str = o_x.png
    ] [
    if ( = $crosshairType 7) [
        str = red_dot.png
    ] [
    if ( = $crosshairType 8) [
        str = star.png
    ] [
    if ( = $crosshairType 9) [
        str = wide.png
    ] [
    if ( = $crosshairType 10) [
        str = x-dot.png
    ] [
    if ( = $crosshairType 11) [
        str = custom
    ] [ ] ] ] ] ] ] ] ] ] ] ] ]
    loadcrosshair $str
    crosshairsize $size

]
//END Crosshair Switcher by Verse
[Image: 942178_10202211084025654_201418072_n.jpg]

Reply
#4
Version 0.30.2
Removed a lingering ']'

Version 0.30.1
made the tabs 8 spaces instead of 4 to be compatible with notepad

Version 0.30
Added instructions and improved documentation
added default settings to a line with AC default settings
removed obsolete code.
totally reworked some logic

Code:
// Crosshair Switcher by Verse version 0.30.2
// This script allows you to set the type and size of each
// weapons' crosshair.
// You can to cusumize the section labled "B I N D S" and
// the section labeled "S E T T I N G S" to fit your needs


//--------------------- B I N D S -------------------------
//This script is designed to use these binds.  Customize
//these binds to conform with your current keybord layout.
//The current settings essentially  are essentially the
//default actions of a new installation.

//MOUSE1 is exicuted on left-click
    bind "MOUSE1" [ mouse1Click ]
    
//MOUSE2 is exicuted on right-click
    bind "MOUSE2" [ mouse2Click ]
    
//MOUSE3 is exicuted on middle click
    bind "MOUSE3" [ mouse3Click ]
    
//MOUSE4 is exicuted by scrolling up on the mouse
//scroll wheel
    bind "MOUSE4" [ mouse4ScrollUp]
    
//MOUSE5 is exicuted by scrolling down on the mouse
//scroll wheel
    bind "MOUSE5" [ mouse5ScrollDown]

//The following binds are 1, 2, 3, and 4. I prefer
//A, Z, MOUSE2, and Q.
    bind "1" [primaryCustCrosshair]
    bind "2" [secondaryCustCrosshair]
    bind "3" [grenadesCustCrosshair]
    bind "4" [meleeCustCrosshair]

alias setCrosshair [
    //size
    alias size = 15
    alias crosshairType = 0

//------------------- S E T T I N G S ---------------------
//INSTRUCTIONS FOR SETTING CROSSHAIR SIZE AND TYPE    

// SIZE
// To change a weapon's size you change the number under
// "CROSSHAIR SIZE" in that weapon's row.   The range is
// 0 to 50.

// TYPE
// To change the crosshair type, you put the name of the
// crosshair you would like under under 'CROSSHAIR TYPE' in
// that weapon's row.  The file you would like to use must
// be in the crosshairs folder.  A list of the standard
// crosshairs and their discriptions is provided.

// For example
// If you want to make your knife's crosshair bigger you
// put the number 50 under crosshair size as it is right
// now.

// If you want to change your knife's crosshair to a  
// circle with a cross in the middle.  You look for
// 'o_x.png' on the "CROSSHAIR LIST.  Then you scroll down
// to "WEAPON SETTINGS".  Then you change the name of the
// current crosshair to o_x.png as it is right now.


//----------------------- C R O S S H A I R  L I S T ---------------------------
// TYPE        DESCRIPTION
//------------------------------------------------------------------------------
// cube.png    Vertial and Horizontal X
// default.png    Same as cube.png but with an empty middle
// dot.png    White dot
// dot_wide.png    White dot with 'T's at the outer edges
// o.png    Circle
// o_dot.png    Circle with a dot
// o_x.png    Combination of o.png and default.png
// red_dot.png    Red Dot
// star.png    A small circular dot with short vertial and horizontal lines
// wide.png    Dot_wide, without the dot
// x-dot.png    Default.png with a dot in the middle
// custom    Anycustom crosshair in the 'crosshairs' folder
    
//--------------------   W E A P O N  S E T T I N G S     -------------------------
//WEAPON    WEAPON        CROSSHAIR SIZE             CROSSHAIR TYPE
//NAME        NO           \/                |--------------|
//-------------------------------------------------------------------------------
//knife        0
if (= 0 (curweapon)) [    alias size 50;    alias crosshairType o_x.png        ] [ //knife
//pistol    1
if (= 1 (curweapon)) [    alias size 30;    alias crosshairType dot_wide.png    ] [ //pistol
//carabine    2
if (= 2 (curweapon)) [    alias size 12;    alias crosshairType dot_wide.png    ] [ //carabine
//shotgun    3
if (= 3 (curweapon)) [    alias size 50;    alias crosshairType o_dot.png        ] [ //shotgun
//subM        4
if (= 4 (curweapon)) [    alias size 20;    alias crosshairType dot_wide.png    ] [ //subM
//sniper    5
if (= 5 (curweapon)) [    alias size 50;    alias crosshairType cube.png        ] [ //sniper
//assaultR    6
if (= 6 (curweapon)) [    alias size 12;    alias crosshairType dot_wide.png    ] [ //assaultR
//grenade    8
if (= 8 (curweapon)) [    alias size 30;    alias crosshairType dot_wide.png    ] [ //grenade
//akimbo    9
if (= 9 (curweapon)) [    alias size 30;    alias crosshairType dot_wide.png    ] [ //akimbo
] ] ] ] ] ] ] ] ]
setCrosshairAction $size $crosshairType
]

//END OF SETTINGS
//------------------------WARNING-----------------------
// Changing anything below this message could cause this
// script to stop working.
// On the other hand if you want to play with this scipt
// this where the fun stuff starts
//              HAVE FUN!!!
//----------------------END WARNING---------------------
alias mouse1Click [
    attack    
    resetAfterEvent
]
alias mouse2Click [
    if $editing [
        showmenu editing
    ] [
        altaction
        resetAfterEvent
    ]
]
alias mouse3Click [
    weapon    
    sleepSetCrosshair
]
alias mouse4ScrollUp [
    universaldelta  1
    sleepSetCrosshair
]
alias mouse5ScrollDown [
    universaldelta -1
    sleepSetCrosshair
]
//END BINDS


//DIRECT SELECT
//These allow direct selection of primary weapon, pistol,
//knife, and grenades weapons in game

alias primaryCustCrosshair [
    setWeapon (currentprimary)
    sleepSetCrosshair
]

alias meleeCustCrosshair [
    setWeapon 0
    sleepSetCrosshair
]

alias secondaryCustCrosshair [
    setWeapon 1
    sleepSetCrosshair
]

alias grenadesCustCrosshair [
    setWeapon 8
    resetAfterEvent
]

alias resetAfterEvent [
    alias count 0
    while [ (< $count 2051) ] [
        alias i 0
        sleep $count [
            setCrosshair
        ]
        alias count (+ $count 50)
    ]
]

//This codeblock is used by DIRECT SELECT
alias setWeapon [
    num = $arg1
    
//    Knife    0
    if (= $num 0) [
        melee
    ] [
//    Pist    1
    if (= $num 1) [
        secondary
    ] [
//    Cbine    2
    if (= $num 2) [
        primary
    ] [
//    Shot    3
    if (= $num 3) [
        primary
    ] [
//    subM    4
    if (= $num 4) [
        primary
    ] [
//    snipe    5
    if (= $num 5) [
        primary
    ] [
//    AR        6
    if (= $num 6) [
        primary
    ] [
//    nade    8
    if (= $num 8) [
        grenades
    ] [
//    akimbo    9
    if (= $num 9) [
        secondary
    ] [ ] ] ] ] ] ] ] ] ]
]
//END DIRECT SELECT

//SETCROSSHAIR
//This code block allows you to customize the size and shape
//of every crosshair for every weapon.  See instructions
//below under "Set CrosshairType"

alias sleepSetCrosshair [
    sleep 300 [setCrosshair]
]

alias setCrosshairAction [
    crosshairsize $arg1
    loadcrosshair $arg2
]
//END Crosshair Switcher by Verse
[Image: 942178_10202211084025654_201418072_n.jpg]

Reply
#5
(09-06-2011, 10:28 PM)Verse Wrote:
Code:
... cusumize...
... exicuted...
... exicuted...
... exicuted...
... exicuted...
... exicuted...
... Vertial...
... Vertial...
... Anycustom...
I'm being picky. I'll go check it out now. XD

EDIT: Good job, many people have tried only to fail at making one of these. Smile
EDIT II: Also, the line about the sniper crosshair is unnecessary.
Reply
#6
(09-07-2011, 11:45 PM)Orynge Wrote: EDIT: Good job, many people have tried only to fail at making one of these. Smile
Thanks I was inspired by RR's crosshair script.


(09-07-2011, 11:45 PM)Orynge Wrote: EDIT II: Also, the line about the sniper crosshair is unnecessary.
Correct, in fact it causes a weird crosshair action when the sniper is used. I left it in to make everything look similar. I'll remove it in the next release and make a note in the description saying that this has no effect on the sniper crosshair. Thanks Orynge
[Image: 942178_10202211084025654_201418072_n.jpg]

Reply
#7
First comment (more to come probably):

I'd make setting aliases so it is easier to change. So instead of:
if (= 0 (curweapon)) [ alias size 50; alias crosshairType o_x.png ] [ //knife

Make a settings with:
Setting_Knife = [ alias size 50; alias crosshairType o_x.png ] //Knife


and down in the compounded if section:
if (= 0 (curweapon)) [ Setting_Knife ] [ //knife
Reply
#8
Version 0.31
Made changes suggested by Ronald_Reagan. THANKS
Modified Sniper to be even more irrelevant, and made a note in the instructions reflecting this. Thanks Orynge.
Code:
// Crosshair Switcher by Verse version 0.31
// With inspiration from Ronald_Reagan
// This script allows you to set the type and size of each
// weapons' crosshair.
// You can to cusumize the section labled "B I N D S" and the
// section labeled "S E T T I N G S"to fit your needs


//------------------- B I N D S ------------------------
//This script is designed to use these binds.  Customize
//these binds to fit your needs.  To the best of my
//knowledge these binds will not interfere with mapping.
    //MOUSE1 is exicuted on left-click
    bind "MOUSE1" [ mouse1Click ]
    //MOUSE2 is exicuted on right-click
    bind "MOUSE2" [ mouse2Click ]
    //MOUSE3 is exicuted on middle click
    bind "MOUSE3" [ mouse3Click ]
    //MOUSE4 is exicuted by scrolling up on the mouse
    //scroll wheel
    bind "MOUSE4" [ mouse4ScrollUp]
    //MOUSE5 is exicuted by scrolling down on the mouse
    //scroll wheel
    bind "MOUSE5" [ mouse5ScrollDown]
    //The following binds are usually 1, 2, and 4
    //respectivly.  I prefer A, Z and Q as they are more
    //effective for me.
    bind "1" [primaryCustCrosshair]
    bind "2" [secondaryCustCrosshair]
    bind "3" [grenadesCustCrosshair]
    bind "4" [meleeCustCrosshair]



//-------------- S E T T I N G S ----------------
//INSTRUCTIONS FOR SETTING CROSSHAIR SIZE AND TYPE    

// SIZE
// To change a weapon's size you change the number under
// "CROSSHAIR SIZE" in that weapons row.   The range is
// from 0 to 50.
// Note: the sniper is only included to keep the script
// congruent, it fills no purpose and thus the size is 0.

// TYPE
// To change the crosshair type, you put the name of the
// crosshair you would like under under 'CROSSHAIR TYPE' in
// that weapons row.  The file you would like to use must
// be in the crosshairs folder.  A list of the standard
// crosshairs and their discriptions is provided.

// For example
// if you want to change your knife crosshair to
// a circle with a dot in the middle.  You look for
// 'o_dot.png' on the "CROSSHAIR LIST.
// Then you scroll down to "WEAPON SETTINGS".  Once there
// you set "CROSSHAIR SIZE" of your knife to 50 and .


//----------------------- C R O S S H A I R  L I S T ---------------------------
//  CROSSHAIR TYPE    DESCRIPTION
//------------------------------------------------------------------------------
//    cube.png     Vertial and Horizontal X
//    default.png  Same as cube.png but with an empty middle
//    dot.png      White dot
//    dot_wide.png White dot with 'T's at the outer edges
//    o.png        Circle
//    o_dot.png    Circle with a dot
//    o_x.png      Combination of o.png and default.png
//    red_dot.png  Red Dot
//    star.png     A small circular dot with short vertial and horizontal lines
//    wide.png     Dot_wide, without the dot
//    x-dot.png    Default.png with a dot in the middle
//    custom       Anycustom crosshair in the 'crosshairs' folder

//--------------------   W E A P O N  S E T T I N G S     --------------------------------
//               WEAPON             CROSSHAIR SIZE                  CROSSHAIR TYPE
//               NAME                   \/                       |--------------|
//--------------------------------------------------------------------------------------

        Setting_Knife = [ alias size    50;   alias crosshairType   o_x.png     ]
       Setting_Pistol = [ alias size    30;   alias crosshairType   dot_wide.png     ]
     Setting_Carabine = [ alias size    12;   alias crosshairType   dot_wide.png     ]
      Setting_Shotgun = [ alias size    50;   alias crosshairType   o_dot.png     ]
Setting_SubmachineGun = [ alias size    20;   alias crosshairType   dot_wide.png     ]
Setting_AssaultRifle = [ alias size    12;   alias crosshairType   dot_wide.png     ]
      Setting_Grenade = [ alias size    30;   alias crosshairType   dot_wide.png     ]
       Setting_Akimbo = [ alias size    30;   alias crosshairType   dot_wide.png     ]
       Setting_Sniper = [ alias size    00;   alias crosshairType   dot_wide.png     ]



//END OF SETTINGS
//------------------------WARNING-----------------------
// Changing anything below this message could cause this
// script to stop working.
// On the other hand if you want to play with this scipt
// this where the fun stuff starts
//               HAVE FUN!!!
//----------------------END WARNING---------------------



alias setCrosshair [
    //size
    alias size = 15
    alias crosshairType = 0
    //knife        0
    if (= 0 (curweapon)) [Setting_Knife] [
    //pistol    1
    if (= 1 (curweapon)) [Setting_Pistol] [
    //carbine    2
    if (= 2 (curweapon)) [Setting_Carabine] [
    //shotgun    3
    if (= 3 (curweapon)) [Setting_Shotgun] [
    //subM        4
    if (= 4 (curweapon)) [Setting_SubmachineGun] [
    //assaultR    6
    if (= 6 (curweapon)) [Setting_AssaultRifle] [
    //grenade    8
    if (= 8 (curweapon)) [Setting_Grenade] [
    //akimbo    9
    if (= 9 (curweapon)) [Setting_Akimbo] [
    //sniper    5
    if (= 5 (curweapon)) [Setting_Sniper]
    ] ] ] ] ] ] ] ]
    setCrosshairAction $size $crosshairType
]


alias mouse1Click [
    attack    
    resetAfterEvent
]
alias mouse2Click [
    if $editing [
        showmenu editing
    ] [
        altaction
        resetAfterEvent
    ]
]
alias mouse3Click [
    weapon    
    sleepSetCrosshair
]
alias mouse4ScrollUp [
    universaldelta  1
    sleepSetCrosshair
]
alias mouse5ScrollDown [
    universaldelta -1
    sleepSetCrosshair
]
//END BINDS


//DIRECT SELECT
//These allow direct selection of primary weapon, pistol,
//knife, and grenades weapons in game

alias primaryCustCrosshair [
    setWeapon (currentprimary)
    sleepSetCrosshair
]

alias meleeCustCrosshair [
    setWeapon 0
    sleepSetCrosshair
]

alias secondaryCustCrosshair [
    setWeapon 1
    sleepSetCrosshair
]

alias grenadesCustCrosshair [
    setWeapon 8
    resetAfterEvent
]

alias resetAfterEvent [
    alias count 0
    while [ (< $count 2051) ] [
        alias i 0
        sleep $count [
            setCrosshair
        ]
        alias count (+ $count 50)
    ]
]

//This codeblock is used by DIRECT SELECT
alias setWeapon [
    num = $arg1
    
//    Knife    0
    if (= $num 0) [
        melee
    ] [
//    Pist    1
    if (= $num 1) [
        secondary
    ] [
//    Cbine    2
    if (= $num 2) [
        primary
    ] [
//    Shot    3
    if (= $num 3) [
        primary
    ] [
//    subM    4
    if (= $num 4) [
        primary
    ] [
//    snipe    5
    if (= $num 5) [
        primary
    ] [
//    AR        6
    if (= $num 6) [
        primary
    ] [
//    nade    8
    if (= $num 8) [
        grenades
    ] [
//    akimbo    9
    if (= $num 9) [
        secondary
    ] [ ] ] ] ] ] ] ] ] ]
]
//END DIRECT SELECT

//SETCROSSHAIR
//This code block allows you to customize the size and shape
//of every crosshair for every weapon.  See instructions
//below under "Set CrosshairType"

alias sleepSetCrosshair [
    sleep 300 [setCrosshair]
]

alias setCrosshairAction [
    crosshairsize $arg1
    loadcrosshair $arg2
]
//END Crosshair Switcher by Verse
[Image: 942178_10202211084025654_201418072_n.jpg]

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)