mIRC Home    About    Download    Register    News    Help

Print Thread
Page 4 of 4 1 2 3 4
#160040 24/09/06 03:18 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Quote:
Oh and Riamus2 smile, now I know why you love hash tables so much, they are kick ass. I've been modifying an old socketbot to act more like an infobot using hash tables for the info. Very nice results.


Heh. Yeah, they really are useful. I have a nice card dealing hash table script that I made that deals out cards and include colors (white background and red/black based on suit). I made it for my Cribbage script I'm working on. I kind of put that on hold, though... along with my Scattergories script. I should finish those... My monopoly script is also on hold, but from much longer ago. Oh well.

I haven't released to many scripts... a few are on my site (Weather script, Dictionary script, $DateXpander (do a search here for info on that if you want)) and a few were released on the invision forum (Kick/Ban window, Playlist script for Invision, etc.), but otherwise I've not really released much.

Btw, you don't have to include "2" when saying my nick. It's only there because I forgot my password for Riamus and had a different e-mail, so couldn't retrieve it.


Invision Support
#Invision on irc.irchighway.net
#160041 24/09/06 07:55 AM
Joined: Sep 2006
Posts: 31
S
Sukai Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2006
Posts: 31
you guys are awesome!, really helped me out

how did you guys learn mirc scripting? played with it? any good tutorials or sites?

i only know of here and www.mircscripts.org

#160042 24/09/06 08:59 AM
Joined: Sep 2003
Posts: 261
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2003
Posts: 261
Ahh I gotcha, yeah same deal with me and my nickname on the scifi.com board. Yeah, i've got scripts laying around almost done or half way done that I never finish. frown I think the only one i ever finished completely was the huge mp3player script I created with the help of a few people's ideas. But that was years ago, I took a break from mirc scripting to learn some perl and a bit of php. Just recently started back up with mirc stuff, all these languages can get confuseing at times.

Sukai I never could find a tutorial that would match the mirc help file. I got started by a friend I met in chat teaching me simple on text events. First thing i ever made myself was a bot. smile Best way to learn is just get an idea, and think about how each thing of that idea is going to work. If you can't figure it out ask questions. smile


We don't just write the scripts, we put them to the test! (ScriptBusters)
#160043 27/09/06 09:34 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Quote:
sorry Riamus2 i must of overlooked it, but well what if its made to delay between the lines ? most networks kick you off because you typed too many lines too fast (at least thats what they do over at QuakeNet)


Sorry I didn't get to this right away. This should give you your delay.

Apparently, I was wrong... you can't play a custom window. Well, you can by using an alias, but it still wants a filename. So, here's writing it to a file and playing that. Note that I changed the RED part from what it used to be and I added the GREEN part. Nothing else has changed.

Code:
alias -l CreateHelp {
  hmake Help 100
  if ($isfile(Help.hsh)) { hload Help Help.hsh }
}

on *:start: {
  CreateHelp
}

on *:text:*:#: {
  if ($1 != !learn && $1 != !replace && $1 != !append && $1 != !delete && $1 != !whoset && $1 != !listall && $1 != !last && $1 != $chr(63)) { return }
  if ($hget(Help) == $null) { CreateHelp }
  if ($1 == !listall) {
    var %list.cnt = 1
    var %line.cnt = 1
    while (%list.cnt <= $hget(Help,0).item) {
      if ($len(%list [ $+ [ %line.cnt ] ]) > 300) { inc %line.cnt }
      var %list. $+ %line.cnt %list. [ $+ [ %line.cnt ] ] $+ , $+ $hget(Help, [ %list.cnt ] ).item
      inc %list.cnt
    }
    var %list.cnt = 1
    while (%list.cnt <= %line.cnt) {
      [color:red]write list.tmp [/color]$right(%list. [ $+ [ %line.cnt ] ],-1)
      inc %list.cnt
    }
    [color:green]play $chan list.tmp 1500
    .remove list.tmp[/color]
    return
  }
  if (!$2) { msg $chan Please include a keyword with the command | return }
  if ($1 == !learn) {
    if ($hget(Help,$2)) { msg $chan That keyword is already used.  Please choose another, or use !replace or !append. | return }
    msg $chan Learned $3-
    hadd Help $2 $nick $3-
  }
  elseif ($1 == $chr(63)) {
    var %data = $gettok($hget(Help,$2),2-,32)
    if (%data == $null) { msg $chan No help available on that item. }
    else {
      msg $chan %data
    }
  }
  elseif ($1 == !replace) {
    if ($hget(Help,$2)) {
      msg $chan Replaced $gettok($hget(Help,$2),2-,32) with $2-
      hadd Help $2 $nick $3-
    }
    else msg $chan No such keyword ( $+ $2 $+ ).
  }
  elseif ($1 == !append) {
    if ($hget(Help,$2)) {
      msg $chan Appended $3- to $hget(Help,$2)
      hadd Help $2 $nick $gettok($hget(Help,$2),2-,32) $3-
    }
    else msg $chan No such keyword ( $+ $2 $+ ).
  }
  elseif ($1 == !delete) {
    if ($hget(Help,$2)) {
      msg $chan Deleted $2 -- $gettok($hget(Help,$2),2-,32)
      hdel Help $2
    }
    else msg $chan No such keyword ( $+ $2 $+ ).
  }
  elseif ($1 == !whoset) {
    if ($hget(Help,$2)) {
      msg $chan $gettok($hget(Help,$2),1,32) was the last person to update $2 $+ .
    }
    else msg $chan No such keyword ( $+ $2 $+ ).
  }
  hsave Help Help.hsh
}


Invision Support
#Invision on irc.irchighway.net
#160044 27/09/06 09:52 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Quote:
you guys are awesome!, really helped me out

how did you guys learn mirc scripting? played with it? any good tutorials or sites?

i only know of here and www.mircscripts.org


I learned by doing it. Back in 2001, I started running TrivBot 2000 and after not very long, I realized that I wanted it to do more than it did. So, I started looking at the scripting and tried to figure out how to make it do what I wanted. Now our trivia bot is more advanced than any other trivia bot I've ever seen and it has around 10,000 questions specifically about old (classic) games for PC, console, and handheld. Of course, I have a lot of prior programming knowledge, so the scripting language isn't really that hard to figure out (or at least get a general idea of what is happening) with that prior knowledge.

I was on Dalnet at the time and it had 2 good #scripting channels... #scripthelp and #scripting, or something like that. I have no idea if those are the correct names or if they are still around. Anyhow, I always went there to ask questions.

As I got more involved with scripting, I started looking at other peoples' scripts to see how they worked. Combining that with mIRC's help file and this forum and the scripting channels, I have been able to figure out what I wanted to do without too much difficulty.

The real trick is this...

1) You need to really *want* to learn it. Otherwise, you won't put in enough effort and it will just be a waste of your time to try.

2) You need to script regularly (or at least play around with scripts, even if you're not writing new ones). When learning any language (computer or human), you learn through use. If you rarely use it, you won't succeed. I would love to relearn C++ (I haven't used it in so long that I forgot most of it), but I don't really have any need for writing programs in it, so learning it isn't really possible --- without needing to use it, I have no incentive to learn it and I don't get enough practice using it. With mIRC, I use it almost every day, so I'm always finding things that I can script or improve or change in scripts, so I have plenty of practice.

3) Learn to use the help file. Many people complain about it because it really isn't all that user friendly. However, it is a GREAT source of information if you know how to use it properly so that you can find what you are looking for.

4) Get some simple scripts from mircscripts.org and see how they do what they do. See if you can edit them to do something else. Start with simple things like on TEXT triggers. Try something like having the script send a message to anyone who says hello. As you progress, you can pick up more difficult scripts... but if you try to skip the easy scripts because you think they are "kid stuff", then you'll never really get very far.

5) Once you have a handle on the easier scripting skills, start paying attention to what people here are writing. Don't start answering scripting questions unless you're sure you know how to do it, but just read the answers others give. If the question is about sockets, for example, and you think you want to try to learn how to use sockets, then look at how the script in the answer looks and try to see how it works. Then start looking at other socket answers in the forum to see similarities. Try changing some things to see if you can make it do something different. Eventually, you can try writing your own. Keep in mind that sockets is advanced and I just used it as an example. The idea is that you see how people do something and then try to make it work for yourself.

6) Ask questions!! However, if you are learning to script, don't just ask if someone can write a script for you. Even just saying, "How can I make a script do ____?" will usually get you a script for an answer. That isn't what you want. Instead, ask the question, but include what you've already tried to create. And make sure to point out that you are trying to learn to do it yourself so that, hopefully, you'll get a good explanation on how to do it.


Invision Support
#Invision on irc.irchighway.net
#160045 28/09/06 08:20 PM
Joined: Mar 2003
Posts: 612
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
7) remember your scripts do what you tell them to do, not what you want them to do....

smirk

btk


billythekid
Page 4 of 4 1 2 3 4

Link Copied to Clipboard