mIRC Home    About    Download    Register    News    Help

Print Thread
#174948 14/04/07 07:23 PM
Joined: Apr 2007
Posts: 6
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Apr 2007
Posts: 6
Hi everyone. I have been trying to hunt this down ever since the beginning of me MIRC scripting..
Alright: I am trying to find a script that lets me set %user.ingame.1 (TO 32 and set it when someone joins this server I host for C&C Renegade. I get this from the log and it says:

Player [Name] has joined.

I would like to set a variable %user.ingame.(Number 1-32) to that name, BUT if someone joined I don't want it to overwrite that user. I would like it to go to %user.ingame.2 and if someone leaves in %user.ingame.1 then let that be available to be written to.
EXAMPLE:
Code:
Player Testing123 joined.
[script bleh]
/set %user.ingame.1 Testing123
Player Sally55 joined.
[script bleh]
/set %user.ingame.2 Sally55
Player Testing123 left
/unset %user.ingame.1
Player Omg524 joined.
/set %user.ingame.1 Omg524

Then, my bot has "commands" like !kick and !ban. I would like to say !kick omg and it would kick omg524 because OMG is in his name. Is this possible?



Thanks and Reguards;
Rexs8
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
For your first item, I'll need to know what kind (if any) message is shown in the channel. The logged information that you supplied is insufficient. Aside from that, what you're wanting can be done.

Regarding #2)
Code:
on @*:text:!kick*:#:{
  var %a = 1
  while %a <= $nick($chan,0) {
    if ($nick($chan,%a) != $me) && ($2 isin $nick($chan,%a)) {
      kick $chan $nick($chan,%a)
      dec %a
    }
    inc %a
  }
}

Code:
on @*:text:!ban*:#:{
  var %a = 1
  while %a <= $nick($chan,0) {
    if ($nick($chan,%a) != $me) && ($2 isin $nick($chan,%a)) {
      ban -k $chan $nick($chan,%a)
      dec %a
    }
    inc %a
  }
}


Joined: Apr 2007
Posts: 6
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Apr 2007
Posts: 6
Sorry, I said my question a bit vaguely. I would like to be able to !kick people in the C&C Renegade SERVER by using logs SAMPLE BELOW:

[21:29:24] Gameplay in progress
[21:29:24] Map : C&C_Walls_Flying.mix
[21:29:24] Time : 4.59.10
[21:29:24] Fps : 30
[21:29:24] GDI : 0/32 players 0 points
[21:29:24] NOD : 0/32 players 0 points
[21:29:24]
[21:30:25] Host: DWCrexs8 is loading the map to join the game!
[21:30:26] The Version of player 1 is 2.900000
[21:30:26] Player DWCrexs8 joined the game
[21:30:26] Westwood Online mode active since 4/14/2007 - 21:28:22 PM
[21:30:26] Gameplay in progress
[21:30:26] Map : C&C_Walls_Flying.mix
[21:30:26] Time : 4.58.08
[21:30:26] Fps : 22
[21:30:26] GDI : 0/32 players 0 points
[21:30:26] NOD : 1/32 players 0 points
[21:30:26]


The bold print I would like to add "DWCrexs8" to %user.ingame.Unusednumberhere with their name and if I type !kick DWC it would kick them by usng a DDE command. Does this make a bit more sense? I appreciate the other script though.



Thanks and Reguards;
Rexs8
Joined: Apr 2007
Posts: 6
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Apr 2007
Posts: 6
Sorry again, I don't know if double-posting is allowed:
I also would like to point out that as $NICK, think of that as $gettok(%readtext,2,32) when someone joins such as Player DWCrexs8 joined the game. and $remove(%readtext,2,32),:) when someone types in the game.



Thanks and Reguards;
Rexs8
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
While double posting is frowned upon, your post doesn't qualify as a double post, since it's a reply. For future reference, you can edit a previous post that you have made within an hour of the posting time.

In regards to your updated post, and your original first request, I don't recommend tracking the players in the method you requested, as it can get very complicated if people leave the channel. Below is the code that I would recommend. It tracks all of the players in a single space delimited variable.

Code:
on *:text:player & joined the game:#:{
  set %user.ingame $addtok(%user.ingame,$2,32)
}
on *:kick:#:{
  set %user.ingame $remtok(%user.ingame,$knick,1,32)
}
on *:part:#:{
  set %user.ingame $remtok(%user.ingame,$nick,1,32)
}
on *:quit:{
  set %user.ingame $remtok(%user.ingame,$nick,1,32)
}


In regards to kicking using DDE commands, I'm sorry to say that I don't have a clue as to how to do that, as I've never received instruction on the format of DDE commands. What I posted earlier will kick/ban per your original request, and the kick/part/quit events in the above code will handle removal of their nick(s) from the players list (if necessary).

Joined: Jan 2007
Posts: 259
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Jan 2007
Posts: 259
I don't think he means this is in IRC, rather its a logfile from his game server. If you'd like, you can contact me on the network (in my profile), or you can send me a PM and I can come over to your network, since I don't have the renegade FDS installed.


Those who can, cannot. Those who cannot, can.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
In my opinion, if this is the case, then he asked in the wrong location, as this forum is for mIRC Scripts & Popups assistance.

Joined: Jan 2007
Posts: 259
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Jan 2007
Posts: 259
His bot is based in mIRC scripting, so he is not asking in the wrong location.


Those who can, cannot. Those who cannot, can.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
and that is what I coded for.

Joined: Jan 2007
Posts: 259
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Jan 2007
Posts: 259
Yes, however you didn't code it use the logfile he was reading from. You coded it to take text from the IRC channel he was in.


Those who can, cannot. Those who cannot, can.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
From my very first post in this topic
Quote:
For your first item, I'll need to know what kind (if any) message is shown in the channel. The logged information that you supplied is insufficient. Aside from that, what you're wanting can be done.


Link Copied to Clipboard