PtokaX forum

Archive => Archived 5.1 boards => Request for scripts => Topic started by: jay-dee on 03 January, 2007, 23:27:11

Title: script input as op?
Post by: jay-dee on 03 January, 2007, 23:27:11
if its possible.......

im an operator in a hub from a friend of mine..


i build the hub for him..

but when i see a error syntax or something like that, is it possible to create a LUA script that i can input
"a script"
to the bot and restart scripts??

that after restart the script is in it?


regards jaydee
Title: Re: script input as op?
Post by: CrazyGuy on 03 January, 2007, 23:38:49
if you have the possibility to add the script into his folder, then yes.
PtokaX has inbuild commands for starting/stopping/restarting scripts
Title: Re: script input as op?
Post by: jay-dee on 04 January, 2007, 07:57:45
i mean, example...

he doesnt have D2AF.LUA and hes running the hub, but hes on vacation...

i load D2AF.LUA into the script save it and restart the scripts...

now D2AF.LUA is in the script list, is that possible to create such a script, to ---->input extern from the ptokax??

regards jaydee
Title: Re: script input as op?
Post by: Snooze on 04 January, 2007, 12:45:33
It can be done, though (as CrazyGuy wrote) you would have to have access to the 'scripts' folder on the computer running the hub.
Ex. by script or FTP.


-Snooze (http://www.dixbot.com)
Title: Re: script input as op?
Post by: UwV on 04 January, 2007, 21:24:05
or you can use a texter ..
a script to read/write texts from
client to files in script folder ..
there is a few not sure what lua versions
but have look for "texter" and you will find it it will do without ftp ..
not really uploading files .. but actually paste copy .. (works for smaller scripts )
 
Title: Re: script input as op?
Post by: jay-dee on 05 January, 2007, 08:23:21
 :D nice script mutor!  thnx! ;D

maybe im a noob  ???

how do i paste a script and save it???
theres only 1 box to save the filename????

help command needs a .txt file???

or im really blind???

regards jaydee
Title: Re: script input as op?
Post by: CrazyGuy on 05 January, 2007, 16:36:53
copy/paste it to notepad and save it as a .lua file ( set file type to All Files )
or, copy/paste it into PtokaX's Script editor and click save there
Title: Re: script input as op?
Post by: UwV on 05 January, 2007, 20:09:35
Quote from: Mutor on 05 January, 2007, 00:03:25
This perhaps is not the wisest method, nor is it recommended
for large scripts or files originally formatted as binary.
But here you are , a little rough perhaps but a good start.
As always, comments welcome

--[[
Script Bot 1.0 LUA 5.0/5.1
By Mutor 01/03/06

........ the hard work .............



thanks Mutor i was afraid he would ask me where to find it ..  this looks better then the older version that was
so  nice one, once again :))
Title: Re: script input as op?
Post by: UwV on 05 January, 2007, 20:16:47
" As always, comments welcome "
" a little rough perhaps but a good start. "
so what about..
a command to change script order ?
that would be a nice next thing i guess .. 

Title: Re: script input as op?
Post by: UwV on 06 January, 2007, 11:41:19
Quote from: Mutor on 05 January, 2007, 22:34:40
Regarding scripot order:

I have been wanting a API call for the scripts for sometime.
Without this we cannot effect a change in the order properly.
Currently we may only fetch the list of scripts by direct command.
The same goes for the other default script commands.
If we could pull a table from the hub it would open up other options.


i have put a request in feature requests a long time ago ... 
but .. no reply/response on that one :/

so i was thinking more like  .. parsing/overwiting the Scripts.xml ...
just, i am not so sure what happens when we reboot all scripts or even reboot hub..
will PX overwite/read  the xml so we loose the changes  or could that work ?
Title: Re: script input as op?
Post by: jay-dee on 06 January, 2007, 17:23:59
Quote from: CrazyGuy on 05 January, 2007, 16:36:53
copy/paste it to notepad and save it as a .lua file ( set file type to All Files )
or, copy/paste it into PtokaX's Script editor and click save there

hmm wrong question of me, or understood quite different........


how do i paste  a script to the bot, of my friends hub???

return "Save Script"," %[line:Filename (ie. filename.lua]"," %[line:Filename (ie. filename.lua]"


Wher do i paste the script???    its only .LUA    saving..........     ????
Title: Re: script input as op?
Post by: UwV on 06 January, 2007, 23:33:00
Quote from: Mutor on 06 January, 2007, 15:59:49
Well we could always attempt to overwrite the xml, but
this  should be an API call which would avoid any problems
altogether.

well,  let's all hope PPK reads this and reconsiders the request(s)..   ;)
it would be very convenient if we could have that one ...
Title: Re: script input as op?
Post by: jay-dee on 07 January, 2007, 16:01:34
 ;D the input on pm(bot) works !!! it loads with no error the script...

i have this script loaded:

-- rightclicker
rMenu = "~~~~?ShareHider?"
qMenu = "~~~~?Records?"




Prof = {
[0] = 1, -- Masters
[1] = 1, -- Operators
[2] = 1, -- Vips
[3] = 1, -- Regs
[4] = 1, -- Moderator
[5] = 1, -- NetFounder
[-1] = 1, -- Users
}
--------------------------------------------------------------------------------------------------------------------
NewUserConnected = function(user)
if Prof[user.iProfile] == 1 then
user:SendData("$UserCommand 0 3")
if user.iProfile == 0 or user.iProfile == 1   then
                        user:SendData("$UserCommand 1 3 "..rMenu.."\\hideshare $<%[mynick]> !hideshare &#124;")
        user:SendData("$UserCommand 1 3 "..rMenu.."\\unhideshare $<%[mynick]> !unhideshare&#124;")
end
if user.iProfile == 0 or user.iProfile == 2   then
                        user:SendData("$UserCommand 1 3 "..qMenu.."\\help $<%[mynick]> !rb.help &#124;")
        user:SendData("$UserCommand 1 3 "..qMenu.."\\show records $<%[mynick]> !rb.show&#124;")
user:SendData("$UserCommand 1 3 "..qMenu.."\\reset records $<%[mynick]> !rb.reset&#124;")
end
end
end


OpConnected = NewUserConnected


but when i reconnect to the hub this comes in main:

[15:54:19] $UserCommand 0 3
[15:54:19] $UserCommand 1 3 ~~~~?ShareHider?\hideshare $<%[mynick]> !hideshare &#124;
[15:54:19] $UserCommand 1 3 ~~~~?ShareHider?\unhideshare $<%[mynick]> !unhideshare&#124;
[15:54:19] $UserCommand 1 3 ~~~~?Records?\help $<%[mynick]> !rb.help &#124;
[15:54:19] $UserCommand 1 3 ~~~~?Records?\show records $<%[mynick]> !rb.show&#124;
[15:54:19] $UserCommand 1 3 ~~~~?Records?\reset records $<%[mynick]> !rb.reset&#124;


how is this possible ???
Title: Re: script input as op?
Post by: jay-dee on 21 January, 2007, 15:29:30
 ???

hmm the script is for operator....

can you change it please to operator and above??

running leviathan, and moderator functions is better then operator so if possible please op and above ??

thnx
Title: Re: script input as op?
Post by: CrazyGuy on 21 January, 2007, 15:47:38
Change


Prof = {
[0] = 1, -- Masters
[1] = 1, -- Operators
[2] = 1, -- Vips
[3] = 1, -- Regs
[4] = 1, -- Moderator
[5] = 1, -- NetFounder
[-1] = 1, -- Users
}


to

Prof = {
[0] = 1, -- Masters
[1] = 1, -- Operators
[2] = 0, -- Vips
[3] = 0, -- Regs
[4] = 1, -- Moderator
[5] = 1, -- NetFounder
[6] = 1, -- Owner profile in Leviathan
[-1] = 0, -- Users
}

Title: Re: script input as op?
Post by: the-master on 09 February, 2007, 16:09:11
noticed a problem whit the script bot  :(
after 6 days my hub refused to send messages from operators in pm and main whit the comment:
you dont have permission to use this command.
seems to disturb the other hubscripts/settings

i stopped scriptbot and problem was gone
advise to start the script only when needed
Title: Re: script input as op?
Post by: plop on 09 February, 2007, 18:58:44
Quote from: jay-dee on 07 January, 2007, 16:01:34
;D the input on pm(bot) works !!! it loads with no error the script...

i have this script loaded:

-- rightclicker
rMenu = "~~~~?ShareHider?"
qMenu = "~~~~?Records?"




Prof = {
[0] = 1, -- Masters
[1] = 1, -- Operators
[2] = 1, -- Vips
[3] = 1, -- Regs
[4] = 1, -- Moderator
[5] = 1, -- NetFounder
[-1] = 1, -- Users
}
--------------------------------------------------------------------------------------------------------------------
NewUserConnected = function(user)
if Prof[user.iProfile] == 1 then
user:SendData("$UserCommand 0 3")
if user.iProfile == 0 or user.iProfile == 1   then
                        user:SendData("$UserCommand 1 3 "..rMenu.."\\hideshare $<%[mynick]> !hideshare &#124;")
        user:SendData("$UserCommand 1 3 "..rMenu.."\\unhideshare $<%[mynick]> !unhideshare&#124;")
end
if user.iProfile == 0 or user.iProfile == 2   then
                        user:SendData("$UserCommand 1 3 "..qMenu.."\\help $<%[mynick]> !rb.help &#124;")
        user:SendData("$UserCommand 1 3 "..qMenu.."\\show records $<%[mynick]> !rb.show&#124;")
user:SendData("$UserCommand 1 3 "..qMenu.."\\reset records $<%[mynick]> !rb.reset&#124;")
end
end
end


OpConnected = NewUserConnected


but when i reconnect to the hub this comes in main:

[15:54:19] $UserCommand 0 3
[15:54:19] $UserCommand 1 3 ~~~~?ShareHider?\hideshare $<%[mynick]> !hideshare &#124;
[15:54:19] $UserCommand 1 3 ~~~~?ShareHider?\unhideshare $<%[mynick]> !unhideshare&#124;
[15:54:19] $UserCommand 1 3 ~~~~?Records?\help $<%[mynick]> !rb.help &#124;
[15:54:19] $UserCommand 1 3 ~~~~?Records?\show records $<%[mynick]> !rb.show&#124;
[15:54:19] $UserCommand 1 3 ~~~~?Records?\reset records $<%[mynick]> !rb.reset&#124;


how is this possible ???

my guess would be that your not using the standard dc++ client but some mod or totaly different client.
some of those format the text, which can cause the hub to recieve the script in a screwed up way (for example magic chars get escaped).

plop
Title: Re: script input as op?
Post by: CrazyGuy on 10 February, 2007, 00:35:40
looks like a client not having supporting UserCommand
Title: Re: script input as op?
Post by: bastya_elvtars on 10 February, 2007, 00:36:54
user.bUserCommand might help in this case.