mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 3 1 2 3
#49535 15/09/03 05:00 AM
Joined: Sep 2003
Posts: 23
N
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Sep 2003
Posts: 23
I joined these forums last week, haven't had as much time as I'd like to learn scripting for IRC but am coming along slowly. I only go to one server dedicated to a site that I mod so I have other things to do...anyway....I use the nnscript from www.nnscript.de and it has mass modes for voicing, devoicing, oping, deoping, but that's where it stops.

Now I have seen how some of you feel about helping with possible "channel takeover code" and I can assure you my stuff is used in good fun, as I'm already an Op there and at most there's maybe 20 people on that server. We all know each other and sometimes like to have fun, mess around, whatever, and I want a mass kick script, but it's out of my realm right now. I can look @ most code and understand it but I can't write it on my own yet. (sorry this post is so long lol)

I'm asking if anyone would like to share their own code for me to use I'd appreciate it, and if you want to visit our server before you 'trust' me to see how it is, I'd be glad to have you visit.

My msn messenger: kipplestein@hotmail.com
My yahoo mess: idi0teque@yahoo.com

Add me to either of those and I'll be happy to share the server with you. And if you don't trust posting it for all to see, again, add me on messenger. Hope I didn't step on too many toes =P /me is back to some scripting while I still have an hour or two of awake time left in me.


#49536 15/09/03 05:15 AM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Writing you any code to work next to a full script can be done, but since there is no way to know what your script does and what parts of it have been worked on, making sure the new code works might be harder than you think. If you're lucky, the author of your script hasn't done anything weird to prevent adding of additional code, but I know several scripts that will go completely boinkers. So should someone decide to post some stuff here for you, don't be surprised if it doesn't work. Be thankful if it does - you then seem to have gotten your hands on a script by an author that isn't overly protective and abusive in his coding...


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#49537 15/09/03 05:20 AM
Joined: Sep 2003
Posts: 23
N
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Sep 2003
Posts: 23
Like I said, I can recognize what the script means, I will look through any script to make sure someone doesn't have too much free time on his/her hands wink And the nnscript has no compatibility problems as far as adding popups/aliases/remotes, I've had no problems so far and doubt I will have any, if I do, I can always revert back to regular old mirc 6.x

#49538 15/09/03 06:12 AM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
alias mk {
var %i 0,%nicks
:next
inc %i
if (%i > $nick($chan,0)) { goto finish }
else {
if ($nick($chan,%i) == $me) { goto next }
elseif ($nick($chan,%i) != $me) { %nicks = %nicks $nick($chan,%i) | goto next }
}
:finish
tokenize 32 %nicks
kick # $replace($1-,$chr(32),$chr(44))
}
/mk for mass kick....
grin


new username: tidy_trax
#49539 15/09/03 09:38 AM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Code:
alias mk {
  var %i = $nick($chan,0)
  while (%x) {
    if ($nick($chan,%i) != $me) kick $chan $nick($chan,%i) message
    dec %i
  }
}


Not being a hypcrite (sp?) - since you already have the code in question, I can't stand lousy coding, so here's a slightly improved version. All those obsolete if statements and goto's...


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#49540 15/09/03 09:40 AM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
goto loops are faster..


new username: tidy_trax
#49541 15/09/03 09:55 AM
Joined: Jan 2003
Posts: 150
J
Vogon poet
Offline
Vogon poet
J
Joined: Jan 2003
Posts: 150
%i instead of %x
Code:
alias mk {
  var %i = $nick($chan,0)
  while (%i) {
    if ($nick($chan,%i) != $me) echo 4 $chan $nick($chan,%i) message
    dec %i
  }
}


Go ahead, jump. 100,000 lemmings can't be wrong.
#49542 15/09/03 01:33 PM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Care to back that up with some facts ? I will test it tonight, but I'm fairly certain one while is gonna be a lot faster than 2 if statements and matching goto's

update: tested with the code below

my while loop (test1) returns 24280 ticks
your goto loop (test2) returns 31664 ticks

Note that the code is virtually similar to what we posted above, including if statements and goto's.

I dare conclude that my while loop is faster

Code:
alias test1 {
  set %ticks $ticks
  var %x = 50000
  while (%x) {
    if (%x >= 0) echo -a test %x
    dec %x
  }
  echo -a time taken: $calc($ticks - %ticks)
}

alias test2 {
  set %t alfa beta
  set %ticks $ticks
  var %x = 0
  :next
  inc %x
  if (%x > 50000) { goto finish }
  else {
    if (%x < 0) { goto next }
    elseif (%x > 0) { echo -a test %x | goto next }
  }
  :finish
  tokenize 32 %t
  echo -a time taken: $calc($ticks - %ticks)
}

Last edited by LocutusofBorg; 15/09/03 01:52 PM.

DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#49543 15/09/03 01:36 PM
Joined: Jun 2003
Posts: 242
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Jun 2003
Posts: 242
In my experience, /while loops are better the majority of the time .. but I've had situations where /goto worked out better.

Edit: Sorry, replied to wrong post .. reply was meant for pheonix.

Last edited by r0ck0; 15/09/03 01:37 PM.
#49544 15/09/03 01:41 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
i dont care to prove it, i cant actually prove it, my friends while loop works faster on his pc, but my goto works faster on mine...


new username: tidy_trax
#49545 15/09/03 01:53 PM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
The do NOT claim "goto loops are faster" - if you cannot back up your claim with experimental data or facts, then don't make it. Both theoretically and practically while loops are faster (see my data above to back up my claim).


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#49546 15/09/03 01:55 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
while loops are faster for you, gotos are faster for me, you cannot prove me wrong if it still works faster on my pc, you can prove WHILE LOOPS ARE FASTER ON MOST, but you still cant prove WHILE LOOPS ARE FASTER kthx.


new username: tidy_trax
#49547 15/09/03 02:39 PM
Joined: Jun 2003
Posts: 242
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Jun 2003
Posts: 242
Code:
alias looptest echo -a while: $wtest ~ goto: $gtest
alias wtest {
  var %ticks = $ticks,%i = 0
  while (%i != 5000) inc %i
  return $calc(($ticks - %ticks) / 1000)
}
alias gtest {
  var %ticks = $ticks,%i = 0
  :start
  if (%i != 5000) {
    inc %i
    goto start
  }
  return $calc(($ticks - %ticks) / 1000)
}


type /looptest

Edit

//timer 10 2 looptest

(6.03)
while: 0.093 ~ goto: 0.141
while: 0.093 ~ goto: 0.141
while: 0.093 ~ goto: 0.141
while: 0.093 ~ goto: 0.141
while: 0.093 ~ goto: 0.141
while: 0.093 ~ goto: 0.141
while: 0.093 ~ goto: 0.141
while: 0.093 ~ goto: 0.141
while: 0.093 ~ goto: 0.157
while: 0.109 ~ goto: 0.141

(6.1)
while: 0.125 ~ goto: 0.187
while: 0.125 ~ goto: 0.156
while: 0.125 ~ goto: 0.171
while: 0.14 ~ goto: 0.188
while: 0.156 ~ goto: 0.219
while: 0.125 ~ goto: 0.171
while: 0.125 ~ goto: 0.171
while: 0.14 ~ goto: 0.156
while: 0.125 ~ goto: 0.171
while: 0.125 ~ goto: 0.171

hmmm .. 6.1 consistently slower .. and it's not connected at
all while 6.03 is connected to 3 networks, 10 channels total.

Last edited by r0ck0; 15/09/03 03:28 PM.
#49548 15/09/03 02:52 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
while: 0.141 ~ goto: 0.187

EDIT:

In addition to being faster, IMO while statements show more understanding abotu what your code is going. It shows you took the time to comlete your thought process about what you want the script to do. Goto's, to me, look like you said" Well, i got it looping.. but i forget to do (this). I can just stick a label in there, and it'l work. Sure, doing it the first time, or even second time may not be bad. But when you start repeating that, then you get the all-too-well-known "Spaghetti code"


-KingTomato
#49549 15/09/03 02:55 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
while: 0.17 ~ goto: 0.131


new username: tidy_trax
#49550 15/09/03 02:58 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
that's funny that the only one who argued the fact that gotos are better, gets the faster goto time.. Might i presume some code tweaking? maybe

<font size="Really big">Gotos Are Faster!!!</font>
<font size="-999">Test studies done under while loop condition fo 100 interations, versus goto loop of 1 iteration</font>


-KingTomato
#49551 15/09/03 03:00 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
i used the code he gave me and thats what it returned....


new username: tidy_trax
#49552 15/09/03 03:01 PM
Joined: Jan 2003
Posts: 150
J
Vogon poet
Offline
Vogon poet
J
Joined: Jan 2003
Posts: 150
tested three times

while: 0.21 ~ goto: 0.261
while: 0.2 ~ goto: 0.281
while: 0.2 ~ goto: 0.271

mIRC v6.1
WinXP PRO

C1.2/512 ram


Go ahead, jump. 100,000 lemmings can't be wrong.
#49553 15/09/03 03:16 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Series of 10...

(v6.1):
while: 0.141 ~ goto: 0.172
while: 0.141 ~ goto: 0.172
while: 0.14 ~ goto: 0.188
while: 0.141 ~ goto: 0.187
while: 0.141 ~ goto: 0.172
while: 0.125 ~ goto: 0.187
while: 0.141 ~ goto: 0.172
while: 0.125 ~ goto: 0.188
while: 0.125 ~ goto: 0.172
while: 0.14 ~ goto: 0.172

(v6.03):
while: 0.141 ~ goto: 0.156
while: 0.125 ~ goto: 0.156
while: 0.125 ~ goto: 0.156
while: 0.125 ~ goto: 0.156
while: 0.109 ~ goto: 0.157
while: 0.125 ~ goto: 0.156
while: 0.125 ~ goto: 0.156
while: 0.125 ~ goto: 0.156
while: 0.125 ~ goto: 0.141
while: 0.125 ~ goto: 0.14


-KingTomato
#49554 15/09/03 04:15 PM
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
(v6.03)
* Timer 1 activated
while: 0.11 ~ goto: 0.16
while: 0.11 ~ goto: 0.15
while: 0.11 ~ goto: 0.15
while: 0.11 ~ goto: 0.16
while: 0.111 ~ goto: 0.16
while: 0.12 ~ goto: 0.151
while: 0.11 ~ goto: 0.151
while: 0.12 ~ goto: 0.15
while: 0.11 ~ goto: 0.15
while: 0.11 ~ goto: 0.15
* Timer 1 halted

(6.1)
* Timer 1 activated
while: 0.14 ~ goto: 0.17
while: 0.131 ~ goto: 0.18
while: 0.15 ~ goto: 0.191
while: 0.13 ~ goto: 0.161
while: 0.13 ~ goto: 0.17
while: 0.23 ~ goto: 0.221
while: 0.13 ~ goto: 0.16
while: 0.13 ~ goto: 0.16
while: 0.13 ~ goto: 0.15
while: 0.121 ~ goto: 0.16
* Timer 1 halted

i dont know how its humanly possible out of several PC's only pheonix has the faster goto. im thinking there has to be a change hes done somewhere to falsify his results.

OS WinXp Pro
Ram 1024mb
mIRC (6.03 & 6.1)


D3m0nnet.com
#49555 15/09/03 04:24 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
I don't doubt that, however, what I'm more inclined to believe is, you ran it to output 5000 iterations, and 4999 said while was faster and only one said goto was faster.

#49556 15/09/03 05:42 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
lmfao codemastr... And kudos to using the word "iterations" as well >:D Not many know the term


-KingTomato
#49557 15/09/03 05:46 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
including me;\


new username: tidy_trax
#49558 15/09/03 05:51 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
An interation, to the layman, is one run through a repetative statement. Meaning if you wanted to do:

var %a = 0
while (%a < 3) {
...
}

that runs 3 iterations. There, now you can tell your parents and sound like a computer geek.

The Few. The Proud. The Geeks.


-KingTomato
#49559 15/09/03 08:03 PM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
There is a simple point in all this: things that are reported to be true are not accepted until the same results can be reproduced by others. So until someone other than you can produce output which produces the results you give (heck, until YOU can give such code to begin with), your claim has no value whatsoever. This has nothing to do with opinion, it's the way the scientific world works. Remember a while back some guys discovered nuclear fusion (or fission) at room temperatures? No one belueves they did, cause no one could reproduce it. the same principle applies here.

Second - others have reported the same results as me, backup up my claim.

Thirdly, (again) - until you can back your claim with data, it has no meaning. You still have not made a singler attempt to back up your statement.

PS: CODEMASTER: I did check that the amt of iterations in my code is the same, in both loops it is exactly 50,000.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#49560 15/09/03 08:26 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
ive still not been proven wrong.....


new username: tidy_trax
#49561 15/09/03 08:40 PM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Yes you have. Several people have posted scri[pting results that prove the while loop to be faster. Until you prove otherwise (backed up by code and test results), you have not made any claim worth anything.

The point of a discussion such as this is to convince the other guy that you are right and he is wrong by the strength of your arguments. So far, I have posed a piece of code with the result, and others have posted results, all supporting my arguments. The only argument you have posted so far is "my computers is different than yours". This is not a valid argument in any discussion.

As said in my previous post - until you can substantiate your claim with a code and results, your claim has no value. If you do not understand this concept - try reading a book on the art of good debating or a good discussion - they will all tell you the principal factor is good arguments. You have not ptovided any. So please provide these arguments (reproducable ones, that's what it's all about) or stop saying the same unsubstantiated thing over and over, as it is not very productive in this discussion.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#49562 15/09/03 08:44 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
like i said, you can only prove it works faster on MOST computers... not all :tongue:, thats what ive said from the beginning, goto loops work faster on MY computer, so you cant say "goto loops are slower because they are on most peoples", so therefore i still havent been proven wrong.....


new username: tidy_trax
#49563 15/09/03 09:00 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Thats not true at all. If you think it is, I suggest you purchase a fantastic book called "Introduction to Algorithms."

All x86 processors are fundamentally the same, some are faster than others, but they are all the same. What I mean by this is (to make up some numbers), if a 500mhz takes 1ms to do an add operation and 100ms to do a multiply, then a 1000mhz takes .5ms to do an add and 50ms to do a multiply. The time it takes to do the multiply is less in the 1000mhz than in the 500mhz, but it is and ALWAYS will be more than the time it takes to do an add operation. The same holds true here. If the goto code uses operations that are ALWAYS slower than the ones used in the while loop, then it will ALWAYS be slower. For you to argue against that simply means you don't understand how a computer works. It is 100% possible, and also very common to be able to tell if an algorithm will ALWAYS be slower than another. There is an entire branch of computer science and of math that deals with it.

If you want to disagree, you are welcome to do so, but you are wrong.

#49564 15/09/03 09:02 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
ok, i must be wrong that: 0.17 seconds is slower than 0.131 shocked


new username: tidy_trax
#49565 15/09/03 09:06 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
*sigh* you just don't want to listen do you? You're the guy who argues that flipping a coin is not a 50:50 chance because it has been proven that 1 out of about every 10^230 flips the coin will land on its edge.

#49566 15/09/03 09:07 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
you cannot say IT IS faster, you can only say IT IS FASTER THE MAJORITY OF THE TIME.


new username: tidy_trax
#49567 15/09/03 09:11 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
No I can say it is faster EVERY time. You don't know how a processor works. When the while loop was executing, perhaps your virus scanner was scanning and eating 100% CPU, and when the goto test was running it was not. That means the while loop goes slower because THE CPU IS BUSY DOING OTHER THINGS. IT DOES NOT MEAN THAT THE WHILE LOOP IS SLOWER, IT MEANS THE CPU DIDN'T EXECUTE THE CODE IT WAS BUSY DOING SOMETHING ELSE.

If you can't understand that, then I'll just say, yes goto is faster, always use goto, every single other person agrees that while is faster, but I'm sure you're the one who is right.

#49568 15/09/03 09:16 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
i didnt say it wasnt right, is it so hard to understand that there is no such thing as an absolute truth?


new username: tidy_trax
#49569 15/09/03 09:25 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Is that a joke? Seeing as how the worlds greatest philosophers have been arguing over the existence of an absolute truth for hundreds of years, YES it is hard to accept you saying there is no such thing as an absolute truth. If the greatest philosophers can't agree on it, why the hell would I assume you are so enlightened that you know the answer that none of them can figure out?

#49570 15/09/03 09:26 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
because things change, things react differently in different places(goto on my comp...).
edit:
i only go by what i think, not what the 'greatest philosophers' think.


new username: tidy_trax
#49571 16/09/03 04:11 AM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
[deleted by poster]

I had some arguments left and some new ones, but I don't see the point. Sorry for wasting everyone's time going back here to see.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#49572 16/09/03 02:37 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
i tried another 10 and while was faster every time;\


new username: tidy_trax
#49573 16/09/03 03:41 PM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
LOL, you gotta be kidding. :tongue: smile


* cold edits his posts 24/7
#49574 16/09/03 03:51 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
my goto massmode is faster than a while massmode though;\


new username: tidy_trax
#49575 16/09/03 03:57 PM
Joined: May 2003
Posts: 161
A
Vogon poet
Offline
Vogon poet
A
Joined: May 2003
Posts: 161
Unless you're going to be modeing thousands of people, it has no significant time difference. So the while is better since it's shorter and looks nicer. smile

#49576 16/09/03 04:40 PM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Your claim is rejected because of the same reasons as above.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#49577 16/09/03 05:30 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
heh


new username: tidy_trax
#49578 16/09/03 06:14 PM
Joined: Dec 2002
Posts: 843
P
Hoopy frood
Offline
Hoopy frood
P
Joined: Dec 2002
Posts: 843
No point in arguing with him, he'll argue black is white till he's blue in the face.


Never compare yourself to others - they're more screwed up than you think.
#49579 16/09/03 06:35 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
im leaving at this actually.


new username: tidy_trax
#49580 16/09/03 06:39 PM
Joined: Jan 2003
Posts: 150
J
Vogon poet
Offline
Vogon poet
J
Joined: Jan 2003
Posts: 150
OK. I think this thread should be closed...


Go ahead, jump. 100,000 lemmings can't be wrong.
Page 1 of 3 1 2 3

Link Copied to Clipboard