Jump to content
  • 1

channel system


AnnieRuru

Question


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

while I was stumbling some of my old topics regarding advance SQL commands

I accidentally found 1 of the most interesting script that I discontinued

http://www.eathena.ws/board/index.php?s=&showtopic=271842&view=findpost&p=1490082

in post#21, got an attachment name guess_me.txt

well that time it was unfinished script, and so do now

however I search on this board, and haven't found any related topics

or maybe someone else already release ?

if nobody haven't did this, I might continue and finish it

for more information, it is a feature of eamod

and I wanted to write my own version

Link to comment
Share on other sites

Recommended Posts


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  251
  • Reputation:   20
  • Joined:  12/22/11
  • Last Seen:  

yes , u right that chanel system is eamod feature :D, will u continue ur work ? i think that will be great :D

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

i remember that topic... i was still a bit noob with sql so, you posted solutions before i could LOL. Even still, you write up scripts far faster than i can D:

I say go for it, there have been more topics in regards to Support & Requests for scripts, than there have been for released scripts in recent times. The same may have held true in eAthena, but atleast then there was about 10scripts released daily (despite duplicates). So it'd be nice to see some fresh 'meat' so to speak being put out on the market.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

okies, but I cannot guarantee I can even start this

right now my priority seems to gear towards battleground related scripts 1st <-- pls stop buying ...

then I'll update all my old scripts from eathena forum to compatible with rathena ...

this one might come very late

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

Since my test has finished last week...and no assignment task to do....while browsing the forum.....and i saw this topic again..xD

so i would like to give this a try haha ~


Script :

http://pastebin.com/raw.php?i=0CiT9zY3

TODO :

// ==== TO-DO ====

  • NPC Dialog Lists
  • Add Block User Features ?
  • Add Password Protected Features ?
  • Add Auto Reject Invitation ?
  • Clean the Scripts .....

Preview :

Create Room :

nYbLd.png

Join an IRC Room

Ds4nv.png

IRC Chit Chat :

SBrbr.png


[MOD] : Able to Invite / Kick users in his IRC Channel.

( Only the 1st User in this IRC Channel will be a [MOD] )

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

Yeah, I even helped someone doing the "Guild Alliance Chat" somewhere in eA old forum... looks really similar to my script :P

I guess it would be a nice feature to work on, even if already released, so if you have time to spare, you should give it a try Annie.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  390
  • Reputation:   27
  • Joined:  07/12/12
  • Last Seen:  

i didn't quite get how to create the room XD

i got i now XD

Edited by stydianx
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

WTH !!! you and @GmOcean has already improved so much

and started to challenge level2 type event script and algorithm script already

ok then ... I think I can safely transfer this script for you to do ...

( but in turn I want to challenge back your party vs party script ... hohoho ... )

well, I still can't comment much on the functionality, because your script also not finish

just 1 thing here inside IRC_Broadcast function

announce ( ( .DisplayTime )?"[ "+gettime(3)+":"+gettime(2)+" ] ":"" ) + getarg(1),bc_self,getarg(2);

better change into

announce ( ( .DisplayTime )?"[ "+gettimestr("%H:%M",7)+" ] ":"" ) + getarg(1),bc_self,getarg(2);

http://www.eathena.ws/board/index.php?s=&showtopic=181741&view=findpost&p=1329705

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

Well, Emistry seems to have this down, as all great things, it takes time.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Emistry, that looks good! :3

I included a similar messaging system inside my way-overcomplicated Queue System, but it's probably more work to edit that than to write the channels from scratch...

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

@Annie

thx for the tips..

for the gettimestr() .... i just dunno what's the usage of the integer inside the gettimestr() ... >.< ( 1 of the reason i didnt choose to use it... another reason is....i forget that it can be use in a way like this.. LOL )

@GMOcean & Euphy

thx.... actually i believe i almost done the script already ~

and..agree with Euphy xD ...write from scratch is easier than edit the original script ... use the original script as references and write a new one haha ~

Script :

http://pastebin.com/raw.php?i=JgBxTudV /oops

TO-DO :

// ==== TO-DO ====

// - NPC Dialog Lists

// - Add Block User Features ?

// - Clean the Scripts .....


// ==== Layout made by AnnieRuru ==========

// join [DONE]

// leave [DONE]

// list players [DONE]

// announce in color [DONE]

// invite player [DONE]

// kick player [DONE]

// reject invitation [DONE]

// block player/guild

// create [DONE]

// more channel [DONE]

// list channel [DONE]

// password [DONE]

// timeout [DONE]

left the Users Blocking part ...[acronym=LOL...the Idea...somehow....GONE.... /swt......]i already got some idea to do it[/acronym]...most probably will try finish all features by tonite if i have some free time... i guess..

the only things i dont know is the 'timeout' part ... i dont know what it's.... O.O

i dont understand what it's.. >.<


EDIT :

hurmm....still got some time before my class start...so...continue this..xD /rice

Thx GMOcean ..... /thx

EDIT2:

Done the 'timeout' .... but somehow...feel like....the script....getting messy and messy ... LOL ... /wah

gonna clean the script hardly and further optimise it ....

Edited by Emistry
Updated again....finished 'timeout' ..
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

Timeout is like inactivity. If they are inactive in the IRC for X amount of minutes, kick them from the channel so that there is free space for future people. Since In some IRC channels they limit the number of people who can enter.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

Timeout is like inactivity. If they are inactive in the IRC for X amount of minutes, kick them from the channel so that there is free space for future people. Since In some IRC channels they limit the number of people who can enter.

lol wrong

during woe, supposedly only guild master or only officers to give commands, normal players should keep silent

if you do it that way, soon all normal players will auto-kick 1 by 1 lol

my idea about timeout is to prevent some noobish players abusing the limit of channel room due to script engine limitation

// Max IRC Room
   .MaxRoom = 10;

which emistry did that already

I can join in a channel and then use @autotrade to hit the limit of channel room by my own

timeout check is like AFK script supposedly, not by kicking out silent players


about blocking party/guild

the idea is like set the channel room to public, but there're some antagonist guild, that you don't want them to join

it just like creating a banlist

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

about the blocking.....player might no need this..because they can make use of the Password Protected features..

where they create a IRC Room with password protected ...and only allow member of the same guild who enter by telling them the password...

but still a good idea for block specific guild ... but not party ...since they can alway re-create a new party in short times...

and..nowaday...not really much player who can stay silent for such long time in game..xD

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  379
  • Reputation:   304
  • Joined:  11/10/11
  • Last Seen:  

Good to see scripts like this !

Some little tips for your future optimization, since it's an intensive script:

  • Don't use getarraysize() in a for loop when it can be cache in a variable (resource friendly), you already do it on some functions
  • Avoid using "for(;;)", it's slower than goto/do/while (ugly parsing in src), it will allow you to remove the freeloop() things
  • Avoid using getarg() in a loop, cache the variable too.

Nice work :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

Good to see scripts like this !

Avoid using "for(; ;)", it's slower than goto/do/while (ugly parsing in src), it will allow you to remove the freeloop() things

lol, I loved the times on eA where people thought they were pro scripters just by using a for( ; ; ) loop.. That time was pretty funny :P

Useless command anyway, there are tons of better ways to make an infinite loop, I totally agree with Key.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

Ahh I see, well. What I suggested is still a timeout lol. But I guess in this case, yeah it wouldn't really work.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

Thx for the advises Keyworld..xD

i alway used FOR-LOOP because it look shorter..xD and it's already a habits for me.. ( i guess i should change my habits now xD )

even in my college ...my lecturers alway ask me to use FOR-LOOP instead of WHILE-LOOP ... >.<

Script : http://pastebin.com/raw.php?i=zQJnCx9j

TO-DO :

  • NPC Dialog Lists
  • Add Block User Features ?
  • Clean the Scripts .....

Added a new function to allow IRC MOD to edit IRC Name or IRC Password anytime .....

Optimised the script as mentioned by KeyWorld ...

How To Use :

NqrBB.png


Haha..feel like this topic has become another 'Scripting Tutorial Topic'

xD

Edited by Emistry
Removed some variables.
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  379
  • Reputation:   304
  • Joined:  11/10/11
  • Last Seen:  

About the for-loop, it's slow only in rathena/frathena, not in others :P

A thing to know: you don't need to initialized some .@var to 0 if this variable is not used before. So you don't need to set .@i to 0 each time since it's already 0.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  66
  • Reputation:   1
  • Joined:  06/06/12
  • Last Seen:  

@emistry how to remove broadcast?

example;

npc:IRC : testing

Only show in chat massage not broadcast

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

@emistry

yeah, you can use for-loop in any other kind of scripts

but for algorithm scripts which usually process high amount of loops, its better to use while-loop instead

EDIT: you can see that my script also uses while-loop, at the end of the file

@LopakTikey

impossible with our current script engine

though, its possible to change its font size smaller

*announce "<text>",<flag>{,<fontColor>{,<fontType>{,<fontSize>{,<fontAlign>{,<fontY>}}}}};

eamod uses source modification,

but this script uses script engine to simulate /oops

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

Only show in chat massage not broadcast

Hmm if I'm not mistaken, it's just a self boradcast, so other people around you can't read it (if other people can read it, then what's the point of joining an IRC room?)

announce ( ( .DisplayTime )?"[ "+gettimestr("%H:%M",7)+" ] ":"" ) + .@message$,[u][b]bc_self[/b][/u],.@colour$;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

event script and algorithm type script is quite high level scripting ( that's why emistry is currently challenging this )

this is an algorithm type script

you can't just simply look at a few lines and you think the script is work like script_commands.txt said

you have to look at the whole script to understand the tricks and the mechanics behind it

the mechanics behind this script is to

whenever a player join a channel ->

1. produce add into a list of .IRC_Room_1$[ getarraysize( .IRC_Room_1$ ) ];

2. the script produce a @IRC temporary player variable

1.

when a player say something with npc:IRC on (read whisper system)

it will loop through all players with .IRC_Room_1$ array with announce "", bc_self;, with attachrid

	while( .@i < .@size ){
	if( attachrid( getcharid( 3,getd( ".IRC_Room_"+.@channel+"$["+.@i+"]" ) ) ) )
		announce ( ( .DisplayTime )?"[ "+gettimestr("%H:%M",7)+" ] ":"" ) + .@message$,bc_self,.@colour$;
	.@i++;
}

2.

the purpose of @IRC player variable is to double check the player is already inside a channel room or not

so if someone send an invitation, the script checks for @IRC player variable with attachrid

if @IRC is 0, means the player is free to join in a channel room

if @IRC is not 0, means the player is already joined an existing channel

well ... the rest are custom features ...

and emistry is exactly following my script format,

I can read this script like someone else doing this for me XD

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

@LopakTikey

perhap the reason we use announce because it can show in different colours....

dispbottom cant archive this... if you want..you still can change it to dispbottom i believe it will still work..

but then ....all your messages that sent to other player...all will look in the same colour with the 'system' message..

it doesnt look nice...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  155
  • Topics Per Day:  0.03
  • Content Count:  647
  • Reputation:   16
  • Joined:  11/21/11
  • Last Seen:  

emistry? is this normal? when all of the players(including me) relog, our irc channel gone, and recreate a new one.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...