Script to disconnect on vote pass
#1
I have another script request, which is unusual for me. Could someone help me disconnect immediately when a vote for a specific map passes, please? Bonus points for editable config file of maps. Maybe even stick in a "gg; nty..." in there.
Thanks given by:
#2
I could, but I'd probably have to use tools.cfg, which is intended for 1104, and possibly buggy in 1202 (also, it seems to throw errors sometimes). Unless.. Has anyone updated it for the latest version?
Also, doing it the way I'm thinking of.. there exists the possibility of other people exploiting your script and causing the script to fire, when you don't want it to..
Thanks given by:
#3
I tried to make:

/onNewMap [ if (= (curmap) ac_douze) [ disconnect; joinservermenu ] ]

But that didn't work for me. I don't know how to use these new "on****" aliases.
Thanks given by:
#4
A dev who can't write code should not be a dev. That is why ac is dead.
Thanks given by:
#5
Uh, RK and jamz aren't in the dev team for coding. RK does packages and jamz manages server/blacklist stuff. :|
(among other things, but coding isn't one of them)
Thanks given by:
#6
For real, kinda harsh there.

Jamz, you're looking for something like onCallVote, but I don't know for sure if its possible to do what you're looking for with it. I'll look into it more and report back.

Randum you're a bit off, that onNewMap alias is executed everytime the /newmap command is, not really what jamz is looking for here.

Edit:

Maybe try something like:

[cubescript]checkinit onCallVote [
btp = $arg1
bcn = $arg2
bmp = $arg3

if (&& (= $btp 7) (strcmp $bmp ac_douze)) [
say "lol no ty noobs"
sleep 1000 disconnect
]
][/cubescript]

Edit #2: Thats not at all on vote pass. I'm stupid. Maybe just change it to "onVoteEnd" ;)
Thanks given by:
#7
Nice fence script.
This could come in fence handy.
No need to shotthrupickups be harsh.
Thanks given by:
#8
I love you.
Thanks given by:
#9
(23 Feb 14, 03:11AM)Jpablon Wrote: A dev who can't write code should not be a dev. That is why ac is dead.

You're a dick and I should ban you, but that hasn't had me do so, has it.
Thanks given by:
#10
(23 Feb 14, 03:22AM)Bukz Wrote: Randum you're a bit off, that onNewMap alias is executed everytime the /newmap command is, not really what jamz is looking for here.

*updates docs*
Thanks given by:
#11
I'm pleased to see no-one could just shoot through a simple answer on this one, but I can pick up some ideas. Are we missing an obvious command here? Perhaps we should fence this thread off for future reference.
Thanks given by:
#12
Bro, Jamz, don't throw a hizzy! I've got your back, I just needed some time to work through this and debug:

// Disconnect on map vote:
onVoteEnd = [ sleep 500 [
    // Sleep allows the client to change map, so that (curmap 1) works properly.
    disconnectmaps = [ map1 map2 ]
    // Space delimited list of maps that we don't like.
    n = (listlen $disconnectmaps)
    // How many maps are there in the disconnectmaps alias?
    loop i $n [
    // Loop as many times as there are maps, as found out above.
        discmapname = (at $disconnectmaps $i)
        // Each loop, pull the next map from the disconnectmaps list.
        if (strcmp $discmapname (curmap 1)) [
        // Then, compare it to the current map.
        say "Hmm, bad map choice..."; sleep 500 [ disconnect; joinservermenu ]
        // then if the current map matches the list, leave the server and show the server menu.
      ]
    ]
  ] 1 // Required: This makes the first sleep ignore any map changes.
]

NOTE: I worry that the sleep for (curmap 1), as commented in this script, might not always work (I'm sure it will, but there's that little bit of doubt that it might not). It would be much better, to remove the need for sleep, and instead have this run as a onMapLoad alias, if that did exist (which it doesn't).


Jpablon: Your code is overly complex.
Thanks given by:
#13
Theres always mapstartonce and mapstartalways.
Thanks given by:
#14
(23 Feb 14, 11:26AM)RandumKiwi Wrote: Bro, Jamz, don't throw a hizzy!
I think you missed my point
(23 Feb 14, 02:38PM)Bukz Wrote: Theres always mapstartonce and mapstartalways.
It has to be before the maps starts, to avoid getting the irrelevant crap uploaded by shitty akimbo 'administrators'.
Thanks given by:
#15
(23 Feb 14, 11:26AM)RandumKiwi Wrote: ...
Jpablon: Your code is overly complex.

I had no idea about persistent sleeps.
There was not a big difference between having fences or not, I used to have a large percentage of unhits anyway.
Thanks given by:
#16
(23 Feb 14, 02:38PM)Bukz Wrote: Theres always mapstartonce and mapstartalways.

Cheers:

// Disconnect on map vote:
mapstartalways = [
    autodownload 0
    autogetmap 0
    // Turn-off auto-map download features. Jamz will getmap manually.
    disconnectmaps = [ camper ]
    // Space delimited list of maps that we don't like.
    n = (listlen $disconnectmaps)
    // How many maps are there in the disconnectmaps alias?
    loop i $n [
    // Loop as many times as there are maps, as found out above.
        discmapname = (at $disconnectmaps $i)
        // Each loop, pull the next map from the disconnectmaps list.
        if (strcmp $discmapname (curmap 1)) [
        // Then, compare it to the current map.
            say "Hmm, bad map choice..."; sleep 0 [ disconnect; joinservermenu ]
            // If the current map matches the list, say something, sleep to allow the
            // message to be sent, then leave the server and show the server menu.
        ]
    ]
]
Thanks given by:
#17
For the love of bukz start using checkinit, its the same thing but better. :p
Thanks given by:
#18
(28 Feb 14, 10:29AM)Bukz Wrote: For the love of bukz start using checkinit, its the same thing but better. :p

Thanks for not showing us the relevance.
Thanks given by:
#19
(28 Feb 14, 10:29AM)Bukz Wrote: For the love of bukz

Awwwwwwwwwwww
Thanks given by:
#20
Using alias = value forcibly overwrites an alias. checkinit won't overwrite it if it already exists, it will just inject the code.
Thanks given by: