mIRC Home    About    Download    Register    News    Help

Print Thread
#26854 29/05/03 06:22 AM
Joined: Feb 2003
Posts: 309
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Feb 2003
Posts: 309
I'm bored; so here's what I've been thinking and pondering about over the past few days: decentralized networks like Gnutella. I already know its possible to create a socket barrier between mIRC and a server, I used to do it to send some rather false information (Sure, yea, yea, I am a JAVA applet, trussssssssssssttttt me).

I'm wokring out a way to do one in PHP (the nature of HTTP is a bitch to deal with, if the client is just IExplorer), and I'm considering doing one in mIRC JUST FOR THE HELL OF IT.

The idea:
You connect to 127.0.0.1 (its protected with an $md5 hash password, chosen randomly, so that your mIRC knows it but no other clients know it (unless you want them to)).
From there, you connect to a mIRC client thats about 24/7, or find an ip from a common channel or some other convenient method of finding out where the network is hiding.
When you connect, your connected to maybe 2 or 3 other mIRCs. The aim of the script is to get a message from Computer A to Computer Z with no direct connection.

Its all very much like the way in guts of the internet works, actually. But, here's my twist bit:
If you read my post about giving something back to khaled, you know I like my ALife.

mIRClets - plain text files of mIRC script commands, akin to what MTS has - aliases of aliases. They do stuff, they wander, they flitter, and probably make a pretty pattern. I'm not sure because I haven't invented them fully yet. Randomly generated to start with, and they breed, etc etc.

What if we used this as a basenetwork for trading "mirclets" or something similar. The smaller and faster a mirclet can transfer, the more dominance it can have. Bigger mirclets can MAP their way around a network, taking more direct routes, meaning they get their faster and can deal with other mIRClets.

If you whacked in messages inside of them, you could develop AN ORGANICALLY GROWN instant messenger (less than instant, maybe).

Am I just a dreamer, or should I get off my butt and do this.
Any suggestions as to how I should implement it, or what the mIRClets/boids/whatever should ACTUALLY DO would be appreciated.

#26855 29/05/03 05:37 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Afaik this really can't be implemented in mIRC scripting, at least not with a huge amount of work. How exactly would you implement Dijkstra's algorithm for finding the shortest distance between 2 computers? mIRC doesn't support recursion, therefore you'd have to write a stack container to simulate recursion, thats not fun at all. To implement this correctly (fast) you also need a priority queue, mIRC doesn't have any queues so you'd have to create a queue, but you'd also need heaping functions to make it a priority queue which again use recursion and therefore require, yet again, a stack to simulate recursion. Seems like, with all the container and recursion simulation it would be so slow it wouldn't be worth it.

#26856 30/05/03 02:31 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
mIRC doesn't support recursion

I'm off-topic, but this statement isn't quite true. mirc does support recursion, it just doesn't allow calling an alias directly from within itself. However, you can very well do something like:
Code:
alias one {
  ....
  if (something) return $two(foo,bar)
  return blah
} 
alias two return $one($1,$2)


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#26857 30/05/03 06:17 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Last time I checked recursion was the ability to call "itself" not call one, call back, call 1, cal back >:P


-KingTomato
#26858 30/05/03 06:38 AM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
It's psudo-recursion. You can't call an alias from within itself, and until recently mIRC wouldn't let you call an alias that already existed in the call stack. However, now that you can recall an alias that already exists in the callstack, you can do something like this:

ALIAS Recursion $$1-

If you want to call an alias recursively, it'd look somewhat like:
ALIAS dostuff { somestuff $1 | recursion dostuff $2- }

Another problem is mIRC only permits a callstack of 100 items (or was it 200 now?)

- Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
#26859 30/05/03 11:26 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
dictionary.com:
recursion

<mathematics, programming> When a function (or procedure)
calls itself. Such a function is called "recursive". If the
call is via one or more other functions then this group of
functions are called "mutually recursive".


As I said, mutually recursive functions are allowed in mirc, so I think we can say "mirc supports recursion".


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#26860 30/05/03 05:03 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
You'd be wrong, when I posted about recursion I meant recursion in a strict sense, that is a function that calls itself directly. The technical definition of recursion is a function that calls itself either directly or indirectly by way of one or more functions. Qwerty is correct, I didn't even think of doing it that way. Btw the "mutual recursion" at least in my experience is a term only used in math, not in programming, if it is recursed by way of another function it is still just referred to as recursion.

#26861 03/06/03 04:47 AM
Joined: Feb 2003
Posts: 309
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Feb 2003
Posts: 309
Mm, yes, did I mention I was probably drunk when I posted that?

Now, the speed wouldn't matter because it wouldn't try to be a fast, efficient network. It would be more of a virtual world for 'mirclets', just a bunch of mIRCs connected loosely in a scattered fashion. Once a message/mIRClet is sent, its passed around until it gets to the target.

*rewrites idea a little bit*
Each mIRClet must do the following to be considered "GOOD".

-Call the correct series of aliases to send itself to another machine.
-When it transfers, it uses something kinda like a header, which contains a "MAXLIFE" property - if it doesn't reach a target before maxlife, then it gets killed off.
-Every time its transfered by one relay to another, it adds the ip to the list, probably hashed (so that people don't just get a list of IP's to attack).

The third property would let you automatically assess which is the more efficient mirclet, the smaller the arriving mirclet, the better it was at transferring (It was either lucky, or directly connected to the target computer)

I don't think you'd have to worry about writing your own shortest distance between computers - you just select the code which does it best.

You'd get mirclets that are highly specialized at transferring over short network distances who simply map a static path. You'd get others (with your randomly generated code) that take their 'best guess' and are more general, thus more adaptable.

Damn I need coffee.

mirclet code would be created from a pool of commands kept it in a text file, called with $read(fname.txt,$rand(1,$lines(fname.txt)), and perhaps some text to replace, like <ip>, <string>, <variant> etc for what could be valid input.

Ah hell I've stumbled a little, my mind is not a razor at 2:21PM (Its, like, light outside for some reason... d-a-y-t-i-m-e... never heard of it... )

Anyways, re your thoughts of 'massive coding task'. This is what I'm pushing coding standards and encapsulation in mIRC for. Too long has the attitude of "me me all me" gone forth, we've not seen much in the way of group projects. Its why I wrote a task manager (albiet a very long time ago). Its why I started mear. It so you can sit a coder who isn't very bright down and say "make an alias in mirc return such and such."

I notice you've been doing it too with your string snippets. By chance are we going to see a lot more output like this of yours?


Link Copied to Clipboard