mIRC Home    About    Download    Register    News    Help

Print Thread
mIRC Forums... #62560
01/12/03 09:31 PM
01/12/03 09:31 PM
Joined: Oct 2003
Posts: 14
P
Proselyte Offline OP
Pikka bird
Proselyte  Offline OP
Pikka bird
P

Joined: Oct 2003
Posts: 14
I'm making these in mIRC "forums". I use the ini playback, and ini write commands to make posts. There is one problem though, when posting on a "thread" if you have already posted there it overwrites your original post. What I'd like is, how to add a number to the nick. Like... If I post once, then my name would be Proselyte01 for that "thread", then next Proselyte02, and on and on my name keeps changing going up and up. Here is my "forum" ini file:
Code:
 [Welcome]
Proselyte=Ok thanks for the welcome
Grau=kthx for the welcome, <censored> hole
[NewThread]
Proselyte=Yo guys sup this is a new "thread"
[GUYS]
Grau=DUDE, THIS THING JUST HAPPENED, THIS THING IS ELITE
 

The [Blah] are the threads. The Proselyte=Ok thanks blah blah are the posts. The way I do this is :
Code:
on *:Text:*`Board*:#WireScrim,#test:{
  writeini Board.ini $2 $nick $3- 
  notice $nick You have posted. Type `Read Board.ini to read posts made.
}
  


As you notice i use $nick, but I was thinking of a number added to the name. Help? Also I'd like something to delete the posts, for certain people. What's the command to delete lines from the ini?

Last edited by Proselyte; 01/12/03 09:34 PM.
Re: mIRC Forums... #62561
01/12/03 09:54 PM
01/12/03 09:54 PM
Joined: Jan 2003
Posts: 3,012
New Hampshire, USA
KingTomato Offline
Planetary brain
KingTomato  Offline
Planetary brain

Joined: Jan 2003
Posts: 3,012
New Hampshire, USA
I'd set it up by hash table. Have an id for each post, and a "parent" id for each one. Ex:

the thread would get (for example) and id of 1 and get a parent id of, say, -1 saying that its a parent. Next, a post in that same thread would have a new id (make it two for the example), but the parent id of 1 saying that its attached to the thread. So you end up with a tree of thread topics like:

Main Discussion (ID:1,PID:-1)
Script Help (ID:2,PID:-1)
Problems (ID:3,PID:-1)

Then say someone makes a thread under main, it would look like:

Hello everyone (ID:4,PID:1)
This is some text in a thread that someone can respond to

Then a post under that would get:

Reply: Hello everyone (ID:5,PID:4)
Hoows it goin

Now you end up with a tree:

Code:
[ Main Discussion ]             (ID:1,PID:-1)
  +- Hello Everyone             (ID:4,PID:1)
    +- Reply: Hello everyone    (ID:5,PID:4)
    +- Reply: Hello everyone    (ID:6,PID:4)

[ Script Help ]                 (ID:2,PID:-1)
  +- New Thread                 (ID:7,PID:2)
    +- Reply: New Thread        (ID:8,PID:7)

[ Problems ]                    (ID:3,PID:-1)

When you want all the posts in the Main Discussion board, do a search for those with a PID value of 1, and likewise to get posts off a thread. Look for a PID value of that thread.

It might sound complicated at first, but that's exactly what forums like this one do. >:D


-KingTomato
Re: mIRC Forums... #62562
01/12/03 10:03 PM
01/12/03 10:03 PM
Joined: Oct 2003
Posts: 14
P
Proselyte Offline OP
Pikka bird
Proselyte  Offline OP
Pikka bird
P

Joined: Oct 2003
Posts: 14
How would I code this?

Re: mIRC Forums... #62563
01/12/03 10:20 PM
01/12/03 10:20 PM
Joined: Jan 2003
Posts: 3,012
New Hampshire, USA
KingTomato Offline
Planetary brain
KingTomato  Offline
Planetary brain

Joined: Jan 2003
Posts: 3,012
New Hampshire, USA
Well, you can first crete a hash table that holds the values by doing /hmake 100 (A hash table with a size of 100. Then you assign token spaced to the id, pid, poster, and then the rest fo the message.

Give me a few minute,s i'll make up a demo


-KingTomato
Re: mIRC Forums... #62564
01/12/03 11:05 PM
01/12/03 11:05 PM
Joined: Oct 2003
Posts: 14
P
Proselyte Offline OP
Pikka bird
Proselyte  Offline OP
Pikka bird
P

Joined: Oct 2003
Posts: 14
Another quick question... what's wrong with this?

Code:
 on *:TEXT:`SScrim:#WireScrim,#test:{
  if ($nick == %Player1 || $nick == %Player2 || $nick == %Player3 || $nick == %Player4 || $nick == %Player5) { /notice $nick You're already on the group for this scrim | halt }
  if (%Player1 == $null) { set $nick %Player1 | notice $nick You'll be in the roster of this scrim, stand by for ip/pw... | halt }
}
 

Re: mIRC Forums... #62565
02/12/03 12:46 AM
02/12/03 12:46 AM
Joined: Jan 2003
Posts: 3,012
New Hampshire, USA
KingTomato Offline
Planetary brain
KingTomato  Offline
Planetary brain

Joined: Jan 2003
Posts: 3,012
New Hampshire, USA
I don't see anything wrong opffhand. Im sorry im taking so long, jsut that I, as always, have to make things perfect. Here is a lil demo of what is to come..

Code:
; -------------------------------------------------------------------------------------------------
; Forum Demo

; -----------------------------------------------------------------------------
; /forum.load
; --
; Ceates the forum, and loads it from forum.hsh (is available)
; -----------------------------------------------------------------------------
alias forum.load {
  if (!$hget(forum)) /hmake forum 100
  if ($isfile(forum.hsh)) /hload forum forum.hsh
  /set %forum.id = $hget(forum, 0).item
}

; -----------------------------------------------------------------------------
; /forum.save
; --
; Saves the forum to forum.hsh
; -----------------------------------------------------------------------------
alias forum.save {
  if ($hget(forum)) /hsave forum forum.hsh
}

; -----------------------------------------------------------------------------
; $Forum.Add(<Params>).Property
; --
; Items:
;
;   $forum.add(Thread Title, Description).Thread
;     Adds a new topic tot he forums
;
;   $forum.add(Parent, Author, Title, Message).Topic
;     Adds a new thread under a topic in refrence to the
;     Thread's id as a parent
;
;   $forum.add(Parent, Author, Message).Reply
;     Adds a reply to a topic, using the original topic's
;     id as a parent id.
; -----------------------------------------------------------------------------
alias forum.add {
  ...
}

; -----------------------------------------------------------------------------
; $forum.view(id/N).Property
; --
; Will return a forum thread/reply/topic given its id
;
; Items (If id is a main thread):
;
;   $forum.view(id).Title
;     View the title of the thread
;
;   $forum.view(id).Description
;     View the description of a thread
;
; Items (If id is a topic):
;
;   $forum.view(id).Parent
;     Threads parent id
;
;   $forum.view(id).Author
;     View the author of an id
;
;   $forum.view(id).Title
;     Name of the topic
;
;   $forum.view(id).Message
;     Message of the topic
;
; Items (If is a reply):
;
;   $forum.view(id).Parent
;     Threads parent id
;
;   $forum.view(id).Author
;     View the author of an id
;
;   $forum.view(id).Message
;     Message of the topic
;
; Items (Other):
;
;   $forum.view(N).Threads
;     View the threads where N is either the Nths thread,
;     or 0 for a complete count
; -----------------------------------------------------------------------------
alias forum.view {
  ...
}


>:D


-KingTomato
Re: mIRC Forums... #62566
02/12/03 05:41 AM
02/12/03 05:41 AM
Joined: Jan 2003
Posts: 3,012
New Hampshire, USA
KingTomato Offline
Planetary brain
KingTomato  Offline
Planetary brain

Joined: Jan 2003
Posts: 3,012
New Hampshire, USA
See if this is what you want. Before you run it, configure the frum headings at the top. I added a /forum.tree to show you how you can navigate the forum. Use /forum.setup to setup the first run. It will then save to forum.hsh every modification to the post. I'm going to work on a channel-driven version of the forum so users can use commands to post and nav the forums.

forum.mrc


-KingTomato
Re: mIRC Forums... #62567
02/12/03 09:30 PM
02/12/03 09:30 PM
Joined: Oct 2003
Posts: 14
P
Proselyte Offline OP
Pikka bird
Proselyte  Offline OP
Pikka bird
P

Joined: Oct 2003
Posts: 14
I kind of wanted it... not client side. Where just regular users typed commands in the channel to view. I'm sure I can try and work it out... i'll give it a shot.
and that script... that I made ... it doesn't work.

Last edited by Proselyte; 02/12/03 09:37 PM.