Which hub software is the best? Where can I find script XXX? Discuss it here...(no, this is not for advertising your hub...)
Moderator: Moderators
-
Animated 0wner
- Posts: 36
- Joined: 2003-04-09 09:04
Post
by Animated 0wner » 2003-04-26 03:15
First thing I should mention is that I'm a complete noob when it comes to writing scripts. With that said, I tried to write a small trigger bot script so that when users used our hub jump to go to another hub of our small network, it would be announced in main chat. The script editor accepts the script, but it doesn't work. Would one of you experts out there please take a look at it and tell me what I did wrong? Lastly, to keep from advertising, I took out all the hub names.
Code: Select all
Dim iTrigger
Dim a(4)
Dim aTriggers(4,2)
Dim sBotName
Dim user
Sub Main
sBotName = "Bot"
iTrigger = 4
user = ""
aTriggers(0,0) = "#hub1"
aTriggers(0,1) = "%USER% went to hub 1."
aTriggers(1,0) = "#hub2"
aTriggers(1,1) = "%USER% went to hub 2."
aTriggers(2,0) = "#hub3"
aTriggers(2,1) = "%USER% went to hub 3."
aTriggers(3,0) = "#hub4"
aTriggers(3,1) = "%USER% went to hub 4."
aTriggers(4,0) = "#hubs"
aTriggers(4,1) = "#hub1 = This hub, #hub2 = That hub, #hub3 = Another hub, #hub4 = Last hub"
End Sub
-
ButterflySoul
- Posts: 210
- Joined: 2003-01-23 22:24
- Location: Nevada
Post
by ButterflySoul » 2003-04-26 04:59
Essentially, visual basix scripts, visual basic (and the visual languages as a whole if I'm not mistaken) work based on events, instead of a linear execution. For example, someone clicking on a button is an event, and has some code linked to it, and the code won't execute unless the event happens =)
The part of the script you posted has a few variable declarations, and a "Sub Main"... The Sub Main is what covers the "startup" event. It's launched when the hub starts, so it's mostly used to setup stuff (in this case to setup the array containing the different messages that another event will then use when it happens)...
Since you don't know much about VBS I assume you grabed this part out of a larger script, and just picked what you needed (which is fine). In the original script, there is probably some code involving aTriggers in other Subs... It should be either in the "Sub DataArival" (triggered when data arrives) either in the "Sub UserConnected" (triggered when a new user connects).
Just by itself, the code you posted is not wrong, but since it contains no code for events aside from the hub starting, it won't do anything at all when a user connects. That's why it doesn't work / nothing happens.
[CoZ] Children of Zeus
-----
Shadows DC Hub - VBS and JS scripting at their best
-
DV Bandit
- Posts: 2
- Joined: 2003-03-15 07:06
Post
by DV Bandit » 2003-04-29 07:37
hmmms whut i would prolly do is just build a set of triggers that users can type that redirect them to the corresponding hubs in your network,then print ur text to main chat for the individual trigger command implemented that make sense? 1 am or would type example... dunno just an idea
¤�¥_ßåÑdÎt¤
Users browsing this forum: Google [Bot] and 0 guests